XFS_SB_VERSION2_LAZYSBCOUNTBIT flag is set in the superblock, these are only updated on-disk when the filesystem is cleanly unmounted (umount or shutdown).

typedef struct xfs_sb
{
__uint32_t sb_magicnum;
__uint32_t sb_blocksize;
xfs_drfsbno_t sb_dblocks;
xfs_drfsbno_t sb_rblocks;
xfs_drtbno_t sb_rextents;
uuid_t sb_uuid;
xfs_dfsbno_t sb_logstart;
xfs_ino_t sb_rootino;
xfs_ino_t sb_rbmino;
xfs_ino_t sb_rsumino;
xfs_agblock_t sb_rextsize;
xfs_agblock_t sb_agblocks;
xfs_agnumber_t sb_agcount;
xfs_extlen_t sb_rbmblocks;
xfs_extlen_t sb_logblocks;
__uint16_t sb_versionnum;
__uint16_t sb_sectsize;
__uint16_t sb_inodesize;
__uint16_t sb_inopblock;
char sb_fname[12];
__uint8_t sb_blocklog;
__uint8_t sb_sectlog;
__uint8_t sb_inodelog;
__uint8_t sb_inopblog;
__uint8_t sb_agblklog;
__uint8_t sb_rextslog;
__uint8_t sb_inprogress;
__uint8_t sb_imax_pct;
__uint64_t sb_icount;
__uint64_t sb_ifree;
__uint64_t sb_fdblocks;
__uint64_t sb_frextents;
xfs_ino_t sb_uquotino;
xfs_ino_t sb_gquotino;
__uint16_t sb_qflags;
__uint8_t sb_flags;
__uint8_t sb_shared_vn;
xfs_extlen_t sb_inoalignmt;
__uint32_t sb_unit;
__uint32_t sb_width;
__uint8_t sb_dirblklog;
__uint8_t sb_logsectlog;
__uint16_t sb_logsectsize;
__uint32_t sb_logsunit;
__uint32_t sb_features2;
} xfs_sb_t;
XFS_SB_MAGIC = 0x58465342 "XFSB".
agf_length value.
|
Flag
|
Description
|
|---|---|
XFS_SB_VERSION_ATTRBIT
|
Set if any inode have extended attributes.
|
XFS_SB_VERSION_NLINKBIT
|
Set if any inodes use 32-bit di_nlink values.
|
XFS_SB_VERSION_QUOTABIT
|
Quotas are enabled on the filesystem. This also brings in the various quota fields in the superblock.
|
XFS_SB_VERSION_ALIGNBIT
|
Set if sb_inoalignmt is used.
|
XFS_SB_VERSION_DALIGNBIT
|
Set if sb_unit and sb_width are used.
|
XFS_SB_VERSION_SHAREDBIT
|
Set if sb_shared_vn is used.
|
XFS_SB_VERSION_LOGV2BIT
|
Version 2 journaling logs are used.
|
XFS_SB_VERSION_SECTORBIT
|
Set if sb_sectsize is not 512.
|
XFS_SB_VERSION_EXTFLGBIT
|
Unwritten extents are used. This is always set.
|
XFS_SB_VERSION_DIRV2BIT
|
Version 2 directories are used. This is always set.
|
XFS_SB_VERSION_MOREBITSBIT
|
Set if the sb_features2 field in the superblock contains more flags.
|
sb_blocksize / sb_inodesize.
sb_blocksize. In other terms, sb_blocksize = 2sb_blocklog.
sb_sectsize.
sb_inodesize.
sb_inopblock.
sb_agblocks (rounded up). This value is used to generate inode numbers and absolute block numbers defined in extent maps.
sb_rextents.
XFS_SB_VERSION_QUOTABIT flag is set in sb_versionnum. Refer to Section 9.1, “ Quota Inodes” for more information.
|
Flag
|
Description
|
|---|---|
XFS_UQUOTA_ACCT
|
User quota accounting is enabled.
|
XFS_UQUOTA_ENFD
|
User quotas are enforced.
|
XFS_UQUOTA_CHKD
|
User quotas have been checked and updated on disk.
|
XFS_PQUOTA_ACCT
|
Project quota accounting is enabled.
|
XFS_OQUOTA_ENFD
|
Other (group/project) quotas are enforced.
|
XFS_OQUOTA_CHKD
|
Other (group/project) quotas have been checked.
|
XFS_GQUOTA_ACCT
|
Group quota accounting is enabled.
|
XFS_SB_VERSION_LOGV2BIT is set in sb_versionnum).
XFS_SB_VERSION_MOREBITSBIT is set in sb_versionnum. The currently defined additional features include:
XFS_SB_VERSION2_LAZYSBCOUNTBIT (0x02): Lazy global counters. Making a filesystem with this bit set can improve performance. The global free space and inode counts are only updated in the primary superblock when the filesystem is cleanly unmounted.
XFS_SB_VERSION2_ATTR2BIT (0x08): Extended attributes version 2. Making a filesystem with this optimises the inode layout of extended attributes.
XFS_SB_VERSION2_PARENTBIT (0x10): Parent pointers. All inodes must have an extended attribute that points back to its parent inode. The primary purpose for this information is in backup systems.
# mkfs.xfs -i attr=2 -n size=16384 -f /dev/sda7
meta-data=/dev/sda7 isize=256 agcount=16, agsize=3923122 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=62769952, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=16384
log =internal log bsize=4096 blocks=30649, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=65536 blocks=0, rtextents=0
xfs_db> sb xfs_db> p magicnum = 0x58465342 blocksize = 4096 dblocks = 62769952 rblocks = 0 rextents = 0 uuid = 32b24036-6931-45b4-b68c-cd5e7d9a1ca5 logstart = 33554436 rootino = 128 rbmino = 129 rsumino = 130 rextsize = 16 agblocks = 3923122 agcount = 16 rbmblocks = 0 logblocks = 30649 versionnum = 0xb084 sectsize = 512 inodesize = 256 inopblock = 16 fname = "\000\000\000\000\000\000\000\000\000\000\000\000" blocklog = 12 sectlog = 9 inodelog = 8 inopblog = 4 agblklog = 22 rextslog = 0 inprogress = 0 imax_pct = 25 icount = 64 ifree = 61 fdblocks = 62739235 frextents = 0 uquotino = 0 gquotino = 0 qflags = 0 flags = 0 shared_vn = 0 inoalignmt = 2 unit = 0 width = 0 dirblklog = 2 logsectlog = 0 logsectsize = 0 logsunit = 0 features2 = 8