fs/xfs/libxfs/xfs_format.h
Source file repositories/reference/linux-study-clean/fs/xfs/libxfs/xfs_format.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/libxfs/xfs_format.h- Extension
.h- Size
- 70491 bytes
- Lines
- 2031
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct xfs_mountstruct xfs_transstruct xfs_inodestruct xfs_bufstruct xfs_iforkstruct xfs_dsbstruct xfs_agflstruct xfs_rtsbstruct xfs_legacy_timestampstruct xfs_dinodestruct xfs_rtbuf_blkinfostruct xfs_disk_dquotstruct xfs_dqblkstruct xfs_dsymlink_hdrstruct xfs_owner_infostruct xfs_rmap_recstruct xfs_rmap_keystruct xfs_rtrmap_rootstruct xfs_refcount_recstruct xfs_refcount_keystruct xfs_rtrefcount_rootstruct xfs_btree_block_shdrstruct xfs_btree_block_lhdrstruct xfs_btree_blockstruct xfs_acl_entrystruct xfs_aclenum xfs_metafile_typeenum xfs_dinode_fmtfunction xfs_sb_is_v5function xfs_sb_has_mismatched_features2function xfs_sb_version_hasmorebitsfunction xfs_sb_version_addattrfunction xfs_sb_version_addquotafunction xfs_sb_version_addattr2function xfs_sb_version_addprojid32function xfs_sb_has_compat_featurefunction xfs_sb_has_ro_compat_featurefunction xfs_sb_has_incompat_featurefunction xfs_sb_has_incompat_log_featurefunction xfs_sb_remove_incompat_log_featuresfunction xfs_sb_add_incompat_log_featuresfunction xfs_sb_version_haslogxattrsfunction xfs_is_quota_inodefunction correspondsfunction xfs_bigtime_to_unixfunction xfs_dinode_sizefunction blocksfunction xfs_dinode_put_rdev
Annotated Snippet
struct xfs_dsb {
__be32 sb_magicnum; /* magic number == XFS_SB_MAGIC */
__be32 sb_blocksize; /* logical block size, bytes */
__be64 sb_dblocks; /* number of data blocks */
__be64 sb_rblocks; /* number of realtime blocks */
__be64 sb_rextents; /* number of realtime extents */
uuid_t sb_uuid; /* user-visible file system unique id */
__be64 sb_logstart; /* starting block of log if internal */
__be64 sb_rootino; /* root inode number */
__be64 sb_rbmino; /* bitmap inode for realtime extents */
__be64 sb_rsumino; /* summary inode for rt bitmap */
__be32 sb_rextsize; /* realtime extent size, blocks */
__be32 sb_agblocks; /* size of an allocation group */
__be32 sb_agcount; /* number of allocation groups */
__be32 sb_rbmblocks; /* number of rt bitmap blocks */
__be32 sb_logblocks; /* number of log blocks */
__be16 sb_versionnum; /* header version == XFS_SB_VERSION */
__be16 sb_sectsize; /* volume sector size, bytes */
__be16 sb_inodesize; /* inode size, bytes */
__be16 sb_inopblock; /* inodes per block */
char sb_fname[XFSLABEL_MAX]; /* file system name */
__u8 sb_blocklog; /* log2 of sb_blocksize */
__u8 sb_sectlog; /* log2 of sb_sectsize */
__u8 sb_inodelog; /* log2 of sb_inodesize */
__u8 sb_inopblog; /* log2 of sb_inopblock */
__u8 sb_agblklog; /* log2 of sb_agblocks (rounded up) */
__u8 sb_rextslog; /* log2 of sb_rextents */
__u8 sb_inprogress; /* mkfs is in progress, don't mount */
__u8 sb_imax_pct; /* max % of fs for inode space */
/* statistics */
/*
* These fields must remain contiguous. If you really
* want to change their layout, make sure you fix the
* code in xfs_trans_apply_sb_deltas().
*/
__be64 sb_icount; /* allocated inodes */
__be64 sb_ifree; /* free inodes */
__be64 sb_fdblocks; /* free data blocks */
__be64 sb_frextents; /* free realtime extents */
/*
* End contiguous fields.
*/
__be64 sb_uquotino; /* user quota inode */
__be64 sb_gquotino; /* group quota inode */
__be16 sb_qflags; /* quota flags */
__u8 sb_flags; /* misc. flags */
__u8 sb_shared_vn; /* shared version number */
__be32 sb_inoalignmt; /* inode chunk alignment, fsblocks */
__be32 sb_unit; /* stripe or raid unit */
__be32 sb_width; /* stripe or raid width */
__u8 sb_dirblklog; /* log2 of dir block size (fsbs) */
__u8 sb_logsectlog; /* log2 of the log sector size */
__be16 sb_logsectsize; /* sector size for the log, bytes */
__be32 sb_logsunit; /* stripe unit size for the log */
__be32 sb_features2; /* additional feature bits */
/*
* bad features2 field as a result of failing to pad the sb
* structure to 64 bits. Some machines will be using this field
* for features2 bits. Easiest just to mark it bad and not use
* it for anything else.
*/
__be32 sb_bad_features2;
/* version 5 superblock fields start here */
/* feature masks */
__be32 sb_features_compat;
__be32 sb_features_ro_compat;
__be32 sb_features_incompat;
__be32 sb_features_log_incompat;
__le32 sb_crc; /* superblock crc */
__be32 sb_spino_align; /* sparse inode chunk alignment */
__be64 sb_pquotino; /* project quota inode */
__be64 sb_lsn; /* last write sequence */
uuid_t sb_meta_uuid; /* metadata file system unique id */
__be64 sb_metadirino; /* metadata directory tree root */
__be32 sb_rgcount; /* # of realtime groups */
__be32 sb_rgextents; /* size of rtgroup in rtx */
__u8 sb_rgblklog; /* rt group number shift */
__u8 sb_pad[7]; /* zeroes */
__be64 sb_rtstart; /* start of internal RT section (FSB) */
__be64 sb_rtreserved; /* reserved (zoned) RT blocks */
/*
* The size of this structure must be padded to 64 bit alignment.
*
* NOTE: Don't forget to update secondary_sb_whack in xfs_repair when
Annotation
- Detected declarations: `struct xfs_mount`, `struct xfs_trans`, `struct xfs_inode`, `struct xfs_buf`, `struct xfs_ifork`, `struct xfs_dsb`, `struct xfs_agfl`, `struct xfs_rtsb`, `struct xfs_legacy_timestamp`, `struct xfs_dinode`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.