pub struct InodeReader<R: Read + Seek> { /* private fields */ }Implementations§
Source§impl<R: Read + Seek> InodeReader<R>
impl<R: Read + Seek> InodeReader<R>
Sourcepub fn new(br: BlockReader<R>) -> Self
pub fn new(br: BlockReader<R>) -> Self
Wrap a BlockReader to provide inode-level access.
Sourcepub fn block_reader(&self) -> &BlockReader<R>
pub fn block_reader(&self) -> &BlockReader<R>
Borrow the underlying BlockReader.
Sourcepub fn block_reader_mut(&mut self) -> &mut BlockReader<R>
pub fn block_reader_mut(&mut self) -> &mut BlockReader<R>
Mutably borrow the underlying BlockReader.
Sourcepub fn read_inode(&self, ino: u64) -> Result<Inode>
pub fn read_inode(&self, ino: u64) -> Result<Inode>
Read and parse inode ino (1-based).
Returns Ext4Error::InodeOutOfRange when ino == 0 or exceeds
the filesystem’s inode count.
Sourcepub fn read_inode_raw(&self, ino: u64) -> Result<Vec<u8>>
pub fn read_inode_raw(&self, ino: u64) -> Result<Vec<u8>>
Read the raw inode bytes for an inode number. Returns the full inode-sized buffer from the inode table.
Sourcepub fn inode_block_map(&self, ino: u64) -> Result<Vec<BlockMapping>>
pub fn inode_block_map(&self, ino: u64) -> Result<Vec<BlockMapping>>
Return the full logical→physical block mapping for inode ino.
Sourcepub fn walk_extent_tree(&self, i_block: &[u8; 60]) -> Result<Vec<BlockMapping>>
pub fn walk_extent_tree(&self, i_block: &[u8; 60]) -> Result<Vec<BlockMapping>>
Walk the extent tree rooted at i_block (60-byte raw field).
The first 12 bytes are the ExtentHeader; subsequent 12-byte slots
are either ExtentLeaf entries (depth == 0) or ExtentIndex entries
(depth > 0) whose child blocks must be read and recursed into.
Sourcepub fn walk_indirect_blocks(
&self,
i_block: &[u8; 60],
) -> Result<Vec<BlockMapping>>
pub fn walk_indirect_blocks( &self, i_block: &[u8; 60], ) -> Result<Vec<BlockMapping>>
Walk legacy indirect-block pointers stored in i_block (60 bytes).
Layout (u32 LE pointers):
- offsets 0..48 (12 direct pointers)
- offset 48 single-indirect pointer
- offset 52 double-indirect pointer
- offset 56 triple-indirect pointer
Sourcepub fn read_inode_data(&self, ino: u64) -> Result<Vec<u8>>
pub fn read_inode_data(&self, ino: u64) -> Result<Vec<u8>>
Read the entire data of inode ino, truncated to inode.size.
For inodes with the INLINE_DATA flag the content is the first
size bytes of i_block (up to 60 bytes), returned directly.
Sourcepub fn read_inode_data_range(
&self,
ino: u64,
offset: u64,
len: usize,
) -> Result<Vec<u8>>
pub fn read_inode_data_range( &self, ino: u64, offset: u64, len: usize, ) -> Result<Vec<u8>>
Read a byte range [offset, offset+len) from inode ino’s data.
This is more efficient than read_inode_data for partial reads
(e.g. FUSE read calls) because it skips blocks that fall entirely
outside the requested window.
Sourcepub fn is_inode_allocated(&self, ino: u64) -> Result<bool>
pub fn is_inode_allocated(&self, ino: u64) -> Result<bool>
Return true if inode ino (1-based) is marked allocated in its
group’s inode bitmap.
Sourcepub fn is_block_allocated(&self, block: u64) -> Result<bool>
pub fn is_block_allocated(&self, block: u64) -> Result<bool>
Return true if block block is marked allocated in its group’s
block bitmap.