pub enum KeyType {
Show 42 variants
InodeItem,
InodeRef,
InodeExtref,
XattrItem,
VerityDescItem,
VerityMerkleItem,
OrphanItem,
DirLogItem,
DirLogIndex,
DirItem,
DirIndex,
ExtentData,
ExtentCsum,
RootItem,
RootBackref,
RootRef,
ExtentItem,
MetadataItem,
ExtentOwnerRef,
TreeBlockRef,
ExtentDataRef,
SharedBlockRef,
SharedDataRef,
BlockGroupItem,
FreeSpaceInfo,
FreeSpaceExtent,
FreeSpaceBitmap,
DeviceExtent,
DeviceItem,
ChunkItem,
RaidStripe,
QgroupStatus,
QgroupInfo,
QgroupLimit,
QgroupRelation,
TemporaryItem,
PersistentItem,
DeviceReplace,
UuidKeySubvol,
UuidKeyReceivedSubvol,
StringItem,
Unknown(u8),
}Expand description
Btrfs item key type, identifying what kind of item a key refers to.
Variants§
InodeItem
Inode metadata (POSIX attributes, timestamps, flags). Key:
(ino, INODE_ITEM, 0). Exactly one per inode in the FS tree.
InodeRef
Hard-link reference from an inode to a parent directory. Key:
(ino, INODE_REF, parent_dir_ino). Multiple refs may be packed
into one item when the inode has several links in the same parent.
InodeExtref
Extended inode reference (when the extref feature is enabled).
Key: (ino, INODE_EXTREF, hash(parent_ino, name)). Stores the
parent inode number inside the struct rather than in the key offset.
XattrItem
Extended attribute stored as a directory-entry-like item. Key:
(ino, XATTR_ITEM, crc32c(name)). Data contains the xattr name
and value.
VerityDescItem
fs-verity descriptor item. Key: (ino, VERITY_DESC_ITEM, 0).
Stores the fs-verity descriptor for a verity-protected file.
VerityMerkleItem
fs-verity Merkle tree block. Key: (ino, VERITY_MERKLE_ITEM, offset).
Stores a block of the Merkle tree used for fs-verity verification.
OrphanItem
Orphan inode marker. Key: (ORPHAN_OBJECTID, ORPHAN_ITEM, ino).
Created when an inode is unlinked while still open; cleaned up on
mount or by orphan cleanup.
DirLogItem
Directory log item (tree-log only). Key:
(dir_ino, DIR_LOG_ITEM, end_range). Used during log replay to
track which directory entries have been logged.
DirLogIndex
Directory log index (tree-log only). Key:
(dir_ino, DIR_LOG_INDEX, end_range). Index counterpart of
DIR_LOG_ITEM.
DirItem
Directory entry keyed by name hash. Key:
(dir_ino, DIR_ITEM, crc32c(name)). Multiple entries may share
the same item when names hash-collide.
DirIndex
Directory entry keyed by sequential index. Key:
(dir_ino, DIR_INDEX, seq). Provides ordered directory iteration
independent of the name hash.
ExtentData
File extent descriptor. Key: (ino, EXTENT_DATA, file_offset).
Describes how a range of file bytes maps to on-disk storage (inline,
regular, or preallocated).
ExtentCsum
Data checksum. Key: (EXTENT_CSUM, EXTENT_CSUM, logical_bytenr).
Stores an array of per-sector CRC32C checksums for a contiguous
range of data blocks.
RootItem
Tree root descriptor. Key: (tree_objectid, ROOT_ITEM, 0). Stored
in the root tree; contains the root block pointer, generation,
subvolume UUIDs, and timestamps.
RootBackref
Backreference from a child subvolume to its parent. Key:
(child_tree_id, ROOT_BACKREF, parent_tree_id). Contains the
directory inode and name where the subvolume is mounted.
RootRef
Forward reference from a parent subvolume to a child. Key:
(parent_tree_id, ROOT_REF, child_tree_id). Same on-disk format
as ROOT_BACKREF.
ExtentItem
Non-skinny extent allocation record. Key:
(bytenr, EXTENT_ITEM, length). Tracks reference counts and
backreferences for a contiguous range of allocated disk space.
MetadataItem
Skinny metadata extent record (when skinny_metadata feature is
enabled). Key: (bytenr, METADATA_ITEM, level). Like EXTENT_ITEM
but the tree block info is encoded in the key offset instead of an
extra header.
ExtentOwnerRef
Simple subvolume ownership reference for an extent. Key:
(bytenr, EXTENT_OWNER_REF, root_objectid). Used with the
simple_quota feature for fast ownership tracking.
TreeBlockRef
Direct backref from a metadata extent to the owning tree. Key:
(bytenr, TREE_BLOCK_REF, root_objectid). The key offset
identifies which tree root owns the block.
ExtentDataRef
Backref from a data extent to a specific file inode. Key:
(bytenr, EXTENT_DATA_REF, hash(root, ino, offset)). Stores
the root, inode, file offset, and reference count.
Shared backref from a metadata extent via a parent block. Key:
(bytenr, SHARED_BLOCK_REF, parent_bytenr). Used for
snapshot-shared tree blocks.
Shared backref from a data extent via a parent tree block. Key:
(bytenr, SHARED_DATA_REF, parent_bytenr). Used for
snapshot-shared data extents; stores a reference count.
BlockGroupItem
Block group descriptor tracking space usage for a chunk. Key:
(logical_offset, BLOCK_GROUP_ITEM, length). Contains bytes used
and the chunk type/RAID profile flags.
FreeSpaceInfo
Free space info for a block group in the free space tree. Key:
(block_group_offset, FREE_SPACE_INFO, block_group_length).
Describes whether the block group uses bitmaps or extents.
FreeSpaceExtent
Free space extent in the free space tree. Key:
(start, FREE_SPACE_EXTENT, length). Represents a contiguous
free range; the item has no data payload.
FreeSpaceBitmap
Free space bitmap in the free space tree. Key:
(start, FREE_SPACE_BITMAP, length). A bitmap covering the
block group’s address range; each bit represents one sector.
DeviceExtent
Physical extent mapping on a device. Key:
(devid, DEV_EXTENT, physical_offset). The inverse of a chunk
stripe: maps a physical range back to the owning chunk.
DeviceItem
Device item describing a single device. Key:
(DEV_ITEMS, DEV_ITEM, devid). Contains size, usage, and UUIDs.
Also embedded in the superblock.
ChunkItem
Chunk item mapping logical to physical addresses. Key:
(FIRST_CHUNK_TREE, CHUNK_ITEM, logical_offset). Contains the
chunk length, RAID profile, and per-device stripe locations.
RaidStripe
RAID stripe extent mapping (for the raid-stripe-tree feature). Key:
(logical_offset, RAID_STRIPE, length). Contains per-device
physical offsets for the stripe.
QgroupStatus
Quota group status. Key: (0, QGROUP_STATUS, 0). Tracks the
overall quota accounting state, rescan progress, and enable
generation.
QgroupInfo
Quota group accounting info. Key:
(level/subvolid, QGROUP_INFO, 0). Tracks referenced and
exclusive bytes for a qgroup.
QgroupLimit
Quota group limits. Key: (level/subvolid, QGROUP_LIMIT, 0).
Caps referenced and/or exclusive space usage for a qgroup.
QgroupRelation
Quota group relation. Key:
(child_qgroupid, QGROUP_RELATION, parent_qgroupid). Defines
the parent-child relationship between qgroups.
TemporaryItem
Temporary item (value 248). BTRFS_BALANCE_ITEM_KEY and
BTRFS_TEMPORARY_ITEM_KEY share this value. Used for balance
status persistence.
PersistentItem
Persistent item (value 249). BTRFS_DEV_STATS_KEY and
BTRFS_PERSISTENT_ITEM_KEY share this value. Used for device
statistics and device replace status.
DeviceReplace
Device replace status. Key: (DEV_REPLACE, DEV_REPLACE, 0).
Persists the state of an in-progress device replace operation
across reboots.
UuidKeySubvol
UUID tree entry for a subvolume. Key:
(upper_uuid_half, UUID_KEY_SUBVOL, lower_uuid_half). Maps a
subvolume UUID to its tree objectid for fast lookup.
UuidKeyReceivedSubvol
UUID tree entry for a received subvolume. Key:
(upper_uuid_half, UUID_KEY_RECEIVED_SUBVOL, lower_uuid_half).
Maps a received UUID to the subvolume objectid.
StringItem
String item (typically the superblock’s label). Key:
(BTRFS_FREE_SPACE_OBJECTID, STRING_ITEM, 0). The data payload
is a raw byte string.
Unknown(u8)
Unrecognized key type byte value.