pub struct TrackedInodeReadGuard<'a>(RwLockReadGuard<'a, Inode>);Expand description
A guard that provides read-only access to the in-memory Inode structure.
This guard is acquired via TrackedInode::read and ensures shared
access to the inode, preventing concurrent writes.
§Use Case
Use this guard when inspecting the state of an inode without making any modifications.
§Example
let guard = tracked_inode.read();
println!("inode size: {}", guard.size);Tuple Fields§
§0: RwLockReadGuard<'a, Inode>Methods from Deref<Target = Inode>§
Sourcepub fn into_disk_format(&self) -> Inode
pub fn into_disk_format(&self) -> Inode
Converts the in-memory Inode structure into its on-disk
representation.
This is used when persisting an inode to disk, typically during
checkpointing or journal submission. The returned disk_layout::Inode
struct matches the format expected by the on-disk inode array.
Sourcepub fn get(
&self,
ffs: &FastFileSystemInner,
fba: FileBlockNumber,
) -> Result<Option<LogicalBlockAddress>, KernelError>
pub fn get( &self, ffs: &FastFileSystemInner, fba: FileBlockNumber, ) -> Result<Option<LogicalBlockAddress>, KernelError>
Retrieves the logical block address (LBA) corresponding to a file block.
§Arguments
ffs: Reference to the file system.fba:FileBlockNumber, relative to the beginning of the file.
§Returns
Ok(lba): The logical block address where the specified file block is stored.Err(KernelError): If the block is not allocated or the block number is out of bounds.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TrackedInodeReadGuard<'a>
impl<'a> !RefUnwindSafe for TrackedInodeReadGuard<'a>
impl<'a> Send for TrackedInodeReadGuard<'a>
impl<'a> Sync for TrackedInodeReadGuard<'a>
impl<'a> Unpin for TrackedInodeReadGuard<'a>
impl<'a> !UnwindSafe for TrackedInodeReadGuard<'a>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more