Expand description
§Typed Rust structs for btrfs tree item payloads
Each on-disk item type has a corresponding struct with a parse method
that reads from a raw byte buffer using safe LE reader helpers. These
structs are the public API for item data; display formatting lives in
the cli crate.
Structs§
- Block
Group Flags - Block group / chunk type flags: the combination of chunk type (DATA, SYSTEM, METADATA) and RAID profile stored in on-disk chunk items and block group items.
- Block
Group Item - Block group descriptor, tracking space usage for a chunk.
- Chunk
Item - Chunk item mapping logical addresses to physical device locations.
- Chunk
Stripe - A single physical stripe within a chunk.
- Device
Extent - Device extent, mapping a physical range on a device to a chunk.
- Device
Item - Device item describing a single device in the filesystem.
- Device
Replace Item - Device replace status, persisted across reboots.
- Device
Stats - Per-device I/O error statistics.
- DirItem
- Directory entry, stored as
DIR_ITEM(hashed by name) orDIR_INDEX(sequential index) in the FS tree. - Extent
Data Ref - Standalone data extent backreference (non-inline).
- Extent
Flags - Extent item flags stored in
btrfs_extent_item::flags. - Extent
Item - Extent allocation record from the extent tree.
- File
Extent Item - File extent descriptor, stored as
EXTENT_DATAin the FS tree. - Free
Space Info - Free space info for a block group in the free space tree.
- Free
Space Info Flags - Free space info flags stored in
btrfs_free_space_info::flags. - Inode
Extref - Extended inode reference, used when the
EXTREFfeature is enabled. - Inode
Flags - Inode item flags stored in
btrfs_inode_item::flags. - Inode
Item - Inode metadata, stored as
INODE_ITEMin the FS tree. - Inode
Item Args - Parameters for creating an inode item.
- Inode
Ref - Hard link reference from an inode to a directory entry.
- Qgroup
Info - Quota group accounting info.
- Qgroup
Limit - Quota group limits.
- Qgroup
Status - Quota group status, stored in the quota tree.
- Raid
Stripe Entry - A single device stripe within a RAID stripe item.
- Raid
Stripe Item - RAID stripe extent mapping (for the raid-stripe-tree feature).
- Root
Item - Root item describing a tree (subvolume, snapshot, or internal tree).
- Root
Item Flags - Root item flags stored in
btrfs_root_item::flags. - RootRef
- Reference linking a subvolume to its parent directory.
- Shared
Data Ref - Shared data extent backreference (for snapshot-shared extents).
- Timespec
- Btrfs timestamp (seconds + nanoseconds since Unix epoch).
- Uuid
Item - UUID tree entry mapping a subvolume UUID to its objectid(s).
Enums§
- Compression
Type - Compression type for file extents.
See also
btrfs_uapi::defrag::CompressTypewhich omitsNone/Unknownfor use in ioctl requests. - File
Extent Body - Body of a file extent: either inline data or a reference to a disk extent.
- File
Extent Type - File extent type.
- File
Type - Directory entry file type, stored in
btrfs_dir_item::type. - Inline
Ref - Inline reference types found inside
EXTENT_ITEM/METADATA_ITEM. - Item
Payload - Parsed item payload: the typed result of parsing a leaf item’s raw data based on its key type.
Functions§
- extent_
data_ ref_ hash - Compute the hash used for
EXTENT_DATA_REFkeys, matching the kernel’shash_extent_data_ref(). Uses two independent CRC32C computations combined into a single u64. - inline_
ref_ size - On-disk size in bytes of an inline backref record (including its 1-byte type tag) for a given inline ref type byte.
- parse_
item_ payload - Parse an item’s raw data into a typed payload based on its key type.