Skip to main content

Module items

Module items 

Source
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§

BlockGroupFlags
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.
BlockGroupItem
Block group descriptor, tracking space usage for a chunk.
ChunkItem
Chunk item mapping logical addresses to physical device locations.
ChunkStripe
A single physical stripe within a chunk.
DeviceExtent
Device extent, mapping a physical range on a device to a chunk.
DeviceItem
Device item describing a single device in the filesystem.
DeviceReplaceItem
Device replace status, persisted across reboots.
DeviceStats
Per-device I/O error statistics.
DirItem
Directory entry, stored as DIR_ITEM (hashed by name) or DIR_INDEX (sequential index) in the FS tree.
ExtentDataRef
Standalone data extent backreference (non-inline).
ExtentFlags
Extent item flags stored in btrfs_extent_item::flags.
ExtentItem
Extent allocation record from the extent tree.
FileExtentItem
File extent descriptor, stored as EXTENT_DATA in the FS tree.
FreeSpaceInfo
Free space info for a block group in the free space tree.
FreeSpaceInfoFlags
Free space info flags stored in btrfs_free_space_info::flags.
InodeExtref
Extended inode reference, used when the EXTREF feature is enabled.
InodeFlags
Inode item flags stored in btrfs_inode_item::flags.
InodeItem
Inode metadata, stored as INODE_ITEM in the FS tree.
InodeItemArgs
Parameters for creating an inode item.
InodeRef
Hard link reference from an inode to a directory entry.
QgroupInfo
Quota group accounting info.
QgroupLimit
Quota group limits.
QgroupStatus
Quota group status, stored in the quota tree.
RaidStripeEntry
A single device stripe within a RAID stripe item.
RaidStripeItem
RAID stripe extent mapping (for the raid-stripe-tree feature).
RootItem
Root item describing a tree (subvolume, snapshot, or internal tree).
RootItemFlags
Root item flags stored in btrfs_root_item::flags.
RootRef
Reference linking a subvolume to its parent directory.
SharedDataRef
Shared data extent backreference (for snapshot-shared extents).
Timespec
Btrfs timestamp (seconds + nanoseconds since Unix epoch).
UuidItem
UUID tree entry mapping a subvolume UUID to its objectid(s).

Enums§

CompressionType
Compression type for file extents. See also btrfs_uapi::defrag::CompressType which omits None/Unknown for use in ioctl requests.
FileExtentBody
Body of a file extent: either inline data or a reference to a disk extent.
FileExtentType
File extent type.
FileType
Directory entry file type, stored in btrfs_dir_item::type.
InlineRef
Inline reference types found inside EXTENT_ITEM/METADATA_ITEM.
ItemPayload
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_REF keys, matching the kernel’s hash_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.