Skip to main content

KeyType

Enum KeyType 

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

§

SharedBlockRef

Shared backref from a metadata extent via a parent block. Key: (bytenr, SHARED_BLOCK_REF, parent_bytenr). Used for snapshot-shared tree blocks.

§

SharedDataRef

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.

Implementations§

Source§

impl KeyType

Source

pub fn from_raw(value: u8) -> Self

Convert a raw on-disk key type byte to a KeyType variant.

Source

pub fn to_raw(self) -> u8

Return the raw u8 key type value.

Trait Implementations§

Source§

impl Clone for KeyType

Source§

fn clone(&self) -> KeyType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeyType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for KeyType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for KeyType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for KeyType

Source§

fn eq(&self, other: &KeyType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for KeyType

Source§

impl Eq for KeyType

Source§

impl StructuralPartialEq for KeyType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.