pub enum ObjectId {
Show 27 variants
RootTree,
ExtentTree,
ChunkTree,
DevTree,
FsTree,
RootTreeDir,
CsumTree,
QuotaTree,
UuidTree,
FreeSpaceTree,
BlockGroupTree,
RaidStripeTree,
RemapTree,
DeviceStats,
Balance,
Orphan,
TreeLog,
TreeLogFixup,
TreeReloc,
DataRelocTree,
ExtentCsum,
FreeSpace,
FreeIno,
CsumChange,
Multiple,
FirstFree,
Id(u64),
}Expand description
Well-known btrfs object IDs used as tree IDs, namespace roots, and special-purpose objectids in item keys.
Variants§
RootTree
The root tree (objectid 1). Contains ROOT_ITEM entries pointing
to the root block of every other tree in the filesystem.
ExtentTree
The extent tree (objectid 2). Tracks all allocated extents (metadata tree blocks and data extents) with backreferences to their owners.
ChunkTree
The chunk tree (objectid 3). Maps logical address ranges to
physical device stripes. Bootstrapped from the superblock’s
sys_chunk_array.
DevTree
The device tree (objectid 4). Contains per-device extent
allocation records (DEV_EXTENT items).
FsTree
The default FS tree (objectid 5). Holds the filesystem content (inodes, directory entries, file extents) for the top-level subvolume. Additional subvolumes/snapshots have objectids >= 256.
RootTreeDir
The root tree directory (objectid 6). A virtual directory entry in the root tree that links to the default subvolume.
CsumTree
The checksum tree (objectid 7). Stores per-block data checksums
as EXTENT_CSUM items.
QuotaTree
The quota tree (objectid 8). Contains qgroup status, info, limit, and relation items for space accounting.
UuidTree
The UUID tree (objectid 9). Provides fast UUID-to-subvolume lookups for send/receive operations.
FreeSpaceTree
The free space tree (objectid 10). Tracks free space per block group using extent or bitmap items, replacing the older free space cache (v1).
BlockGroupTree
The block group tree (objectid 11). Separates block group items
from the extent tree for faster mount times (requires the
block_group_tree compat-ro feature).
RaidStripeTree
The RAID stripe tree (objectid 12). Maps logical extents to
per-device physical stripe offsets for the raid-stripe-tree
feature.
RemapTree
The remap tree (objectid 13). Reserved for future use by the extent-tree-v2 feature.
DeviceStats
Device statistics objectid (0). Used with PERSISTENT_ITEM_KEY
to store per-device I/O error counters.
Balance
Balance status objectid (-4 as u64). Stored in the root tree
as a TEMPORARY_ITEM to persist in-progress balance state.
Orphan
Orphan objectid (-5 as u64). Used as the objectid for
ORPHAN_ITEM keys that mark inodes pending cleanup.
TreeLog
Tree log objectid (-6 as u64). The tree log records recent fsync’d changes for fast replay after a crash.
TreeLogFixup
Tree log fixup objectid (-7 as u64). Temporary items created during log replay to resolve backreferences.
TreeReloc
Tree relocation objectid (-8 as u64). Used during balance to hold relocated tree blocks before they are committed to their final location.
DataRelocTree
Data relocation tree objectid (-9 as u64). A temporary tree used during balance to hold relocated data extents.
ExtentCsum
Extent checksum objectid (-10 as u64). Used as the objectid in
EXTENT_CSUM keys in the checksum tree.
FreeSpace
Free space objectid (-11 as u64). Used in the older free space cache (v1) inode items.
FreeIno
Free inode objectid (-12 as u64). Used for free inode number tracking within FS trees.
CsumChange
Checksum change objectid (-13 as u64). Used during online checksum algorithm conversion.
Multiple
Multiple objectids sentinel (-255 as u64). Used internally to indicate that an extent is referenced by multiple trees.
FirstFree
First user-accessible objectid (256). Inode numbers in FS trees start at this value; the root directory inode is always 256.
Id(u64)
A numeric objectid that doesn’t match any well-known value.
Implementations§
Source§impl ObjectId
impl ObjectId
Sourcepub fn display_with_type(self, key_type: KeyType) -> String
pub fn display_with_type(self, key_type: KeyType) -> String
Display an objectid with context-dependent disambiguation.
Some objectid values have different meanings depending on the key type.
For example, objectid 1 is ROOT_TREE in general but DEV_ITEMS
when used with DEV_ITEM_KEY, and 0 is DEV_STATS when used
with PERSISTENT_ITEM_KEY.
Sourcepub fn from_tree_name(name: &str) -> Option<Self>
pub fn from_tree_name(name: &str) -> Option<Self>
Parse a tree name string (for CLI -t flag) into an ObjectId.