Each AG manages its own inodes. The third sector in the AG contains information about the AG's inodes and is known as the AGI.
The AGI uses the following structure:
typedef struct xfs_agi {
__be32 agi_magicnum;
__be32 agi_versionnum;
__be32 agi_seqno
__be32 agi_length;
__be32 agi_count;
__be32 agi_root;
__be32 agi_level;
__be32 agi_freecount;
__be32 agi_newino;
__be32 agi_dirino;
__be32 agi_unlinked[64];
} xfs_agi_t;
- agi_magicnum
Specifies the magic number for the AGI sector: "XAGI" (0x58414749).
- agi_versionnum
Set to XFS_AGI_VERSION
which is currently 1.
- agi_seqno
Specifies the AG number for the sector.
- agi_length
Specifies the size of the AG in filesystem blocks.
- agi_count
Specifies the number of inodes allocated for the AG.
- agi_root
Specifies the block number in the AG containing the root of the inode B+tree.
- agi_level
Specifies the number of levels in the inode B+tree.
- agi_freecount
Specifies the number of free inodes in the AG.
- agi_newino
Specifies AG relative inode number most recently allocated.
- agi_dirino
Deprecated and not used, it's always set to NULL (-1).
- agi_unlinked[64]