pub struct ExtentItem {
pub refs: u64,
pub generation: u64,
pub flags: ExtentFlags,
pub tree_block_key: Option<DiskKey>,
pub tree_block_level: Option<u8>,
pub skinny_level: Option<u64>,
pub inline_refs: Vec<InlineRef>,
}Expand description
Extent allocation record from the extent tree.
Tracks reference counts, ownership, and backreferences for a contiguous
range of allocated disk space. Used for both data extents (EXTENT_ITEM)
and metadata blocks (METADATA_ITEM with skinny metadata).
Fields§
§refs: u64Number of references to this extent.
generation: u64Generation when this extent was allocated.
flags: ExtentFlagsWhether this extent holds data or a tree block.
tree_block_key: Option<DiskKey>For non-skinny tree block extents: the first key in the block.
tree_block_level: Option<u8>For non-skinny tree block extents: the block’s tree level.
skinny_level: Option<u64>For skinny metadata items: the tree level (from the key offset).
inline_refs: Vec<InlineRef>Inline backreferences packed after the extent header.
Implementations§
Source§impl ExtentItem
impl ExtentItem
Sourcepub const SKINNY_SIZE: usize = 33
pub const SKINNY_SIZE: usize = 33
Size of a skinny metadata extent item with one TREE_BLOCK_REF.
Layout: extent header (24) + inline ref type (1) + offset (8) = 33.
Sourcepub const NON_SKINNY_SIZE: usize = 51
pub const NON_SKINNY_SIZE: usize = 51
Size of a non-skinny metadata extent item with tree_block_info
and one TREE_BLOCK_REF.
Layout: extent header (24) + tree_block_info (18) + inline ref (9) = 51.
Sourcepub const DATA_INLINE_SIZE: usize = 53
pub const DATA_INLINE_SIZE: usize = 53
Size of a data extent item with one inline EXTENT_DATA_REF.
Layout: extent header (24) + inline ref type (1) + data ref (28) = 53.
Sourcepub fn is_tree_block(&self) -> bool
pub fn is_tree_block(&self) -> bool
Returns true if this extent holds a metadata tree block.
Sourcepub fn parse(data: &[u8], key: &DiskKey) -> Option<Self>
pub fn parse(data: &[u8], key: &DiskKey) -> Option<Self>
Parse an extent item from a raw byte buffer, using the item key to determine whether this is a skinny metadata item or a full extent item.
Sourcepub fn to_bytes_skinny(refs: u64, generation: u64, root_id: u64) -> Vec<u8> ⓘ
pub fn to_bytes_skinny(refs: u64, generation: u64, root_id: u64) -> Vec<u8> ⓘ
Serialize a skinny metadata extent item (METADATA_ITEM) with a
single TREE_BLOCK_REF inline backref (33 bytes).
Trait Implementations§
Source§impl Clone for ExtentItem
impl Clone for ExtentItem
Source§fn clone(&self) -> ExtentItem
fn clone(&self) -> ExtentItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more