di_u
"data fork" contains normal data related to the inode. It's contents depends on the file type specified by di_core.di_mode
(eg. regular file, directory, link, etc) and how much information is contained in the file which determined by di_core.di_format
. The following union to represent this data is declared as follows:
union { xfs_bmdr_block_t di_bmbt; xfs_bmbt_rec_t di_bmx[1]; xfs_dir2_sf_t di_dir2sf; char di_c[1]; xfs_dev_t di_dev; uuid_t di_muuid; char di_symlink[1]; } di_u;
di_core.di_aformat
value. Its representation is declared as follows:
union { xfs_bmdr_block_t di_abmbt; xfs_bmbt_rec_t di_abmx[1]; xfs_attr_shortform_t di_attrsf; } di_a;
di_mode/di_format
and di_aformat
values. They are referenced in this document to make it easier to explain the various structures in use within the inode.
di_next_unlinked
where the two forks are located is called the inode's "literal area". This starts at offset 100 (0x64) in the inode.
di_core.di_forkoff
. The data fork is located between the start of the literal area and di_forkoff
. The attribute fork is located between di_forkoff
and the end of the inode.
typedef struct xfs_dinode_core { __uint16_t di_magic; __uint16_t di_mode; __int8_t di_version; __int8_t di_format; __uint16_t di_onlink; __uint32_t di_uid; __uint32_t di_gid; __uint32_t di_nlink; __uint16_t di_projid; __uint8_t di_pad[8]; __uint16_t di_flushiter; xfs_timestamp_t di_atime; xfs_timestamp_t di_mtime; xfs_timestamp_t di_ctime; xfs_fsize_t di_size; xfs_drfsbno_t di_nblocks; xfs_extlen_t di_extsize; xfs_extnum_t di_nextents; xfs_aextnum_t di_anextents; __uint8_t di_forkoff; __int8_t di_aformat; __uint32_t di_dmevmask; __uint16_t di_dmstate; __uint16_t di_flags; __uint32_t di_gen; } xfs_dinode_core_t;
di_onlink
, di_nlink
and di_projid
values in the inode core. Initially, inodes are created as v1 but can be converted on the fly to v2 when required.
di_mode
type. This can be one of several values. For directories and links, it can be "local" where all metadata associated with the file is within the inode, "extents" where the inode contains an array of extents to other filesystem blocks which contain the associated metadata or data or "btree" where the inode contains a B+tree root node which points to filesystem blocks containing the metadata or data. Migration between the formats depends on the amount of metadata associated with the inode. "dev" is used for character and block devices while "uuid" is currently not used.
typedef enum xfs_dinode_fmt { XFS_DINODE_FMT_DEV, XFS_DINODE_FMT_LOCAL, XFS_DINODE_FMT_EXTENTS, XFS_DINODE_FMT_BTREE, XFS_DINODE_FMT_UUID } xfs_dinode_fmt_t;
di_nlink
.
di_pad
).
typedef struct xfs_timestamp { __int32_t t_sec; __int32_t t_nsec; } xfs_timestamp_t;
XFS_DIFLAG_EXTSZINHERIT
flag must be set in di_flags
if this field is used. Inodes created in these directories will inherit the di_extsize value and have XFS_DIFLAG_EXTSIZE
set in their di_flags
. When a file is written to beyond allocated space, XFS will attempt to allocate additional disk space based on this value.
di_forkoff
depends on the XFS_SB_VERSION2_ATTR2BIT
flag in the superblock. Refer to the Extended Attribute Versions section (Section 4.4.1, “Extended Attribute Versions”) for more details.
di_format
, but restricted to "local", "extents" and "btree" formats for extended attribute data.
Flag
|
Description
|
---|---|
XFS_DIFLAG_REALTIME
|
The inode's data is located on the real-time device.
|
XFS_DIFLAG_PREALLOC
|
The inode's extents have been preallocated.
|
XFS_DIFLAG_NEWRTBM
|
Specifies the
sb_rbmino uses the new real-time bitmap format
|
XFS_DIFLAG_IMMUTABLE
|
Specifies the inode cannot be modified.
|
XFS_DIFLAG_APPEND
|
The inode is in append only mode.
|
XFS_DIFLAG_SYNC
|
The inode is written synchronously.
|
XFS_DIFLAG_NOATIME
|
The inode's
di_atime is not updated.
|
XFS_DIFLAG_NODUMP
|
Specifies the inode is to be ignored by xfsdump.
|
XFS_DIFLAG_RTINHERIT
|
For directory inodes, new inodes inherit the
XFS_DIFLAG_REALTIME bit.
|
XFS_DIFLAG_PROJINHERIT
|
For directory inodes, new inodes inherit the
di_projid value.
|
XFS_DIFLAG_NOSYMLINKS
|
For directory inodes, symlinks cannot be created.
|
XFS_DIFLAG_EXTSIZE
|
Specifies the extent size for real-time files or a and extent size hint for regular files.
|
XFS_DIFLAG_EXTSZINHERIT
|
For directory inodes, new inodes inherit the
di_extsize value.
|
XFS_DIFLAG_NODEFRAG
|
Specifies the inode is to be ignored when defragmenting the filesystem.
|