TrackedInodeReadGuard

Struct TrackedInodeReadGuard 

Source
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>§

Source

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.

Source

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§

Source§

impl Deref for TrackedInodeReadGuard<'_>

Source§

type Target = Inode

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.