Skip to main content

ObjectId

Enum ObjectId 

Source
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

Source

pub fn from_raw(value: u64) -> Self

Convert a raw 64-bit objectid to an ObjectId variant.

Source

pub fn to_raw(self) -> u64

Return the raw u64 objectid value.

Source

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.

Source

pub fn from_tree_name(name: &str) -> Option<Self>

Parse a tree name string (for CLI -t flag) into an ObjectId.

Trait Implementations§

Source§

impl Clone for ObjectId

Source§

fn clone(&self) -> ObjectId

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for ObjectId

Source§

impl Debug for ObjectId

Source§

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

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

impl Display for ObjectId

Source§

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

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

impl Eq for ObjectId

Source§

impl Hash for ObjectId

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 ObjectId

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ObjectId

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.