helper functions for extent data structure access

This commit is contained in:
Janis 2023-04-03 17:01:35 +02:00
parent d4f62371f8
commit 578861c4fa
2 changed files with 23 additions and 1 deletions

View file

@ -376,6 +376,28 @@ pub struct ExtentData2 {
num_bytes: U64<LE>,
}
impl ExtentData2 {
pub fn extent_data1(&self) -> &ExtentData1 {
&self.header
}
pub fn address(&self) -> u64 {
self.address.get()
}
pub fn size(&self) -> u64 {
self.size.get()
}
pub fn offset(&self) -> u64 {
self.offset.get()
}
pub fn num_bytes(&self) -> u64 {
self.num_bytes.get()
}
}
#[repr(C, packed(1))]
#[derive(Debug, Clone, Copy, FromBytes, AsBytes)]
pub struct INodeRef {

View file

@ -5,7 +5,7 @@ use alloc::vec::Vec;
use crate::structs::KnownObjectId;
#[derive(Clone)]
#[derive(Clone, PartialEq, Eq)]
pub struct INode {
pub id: u64,
pub(crate) path: Vec<Vec<u8>>,