JournalIO

Struct JournalIO 

Source
pub struct JournalIO<'a> {
    pub ffs: &'a FastFileSystemInner,
}
Expand description

A handle for performing journal I/O operations.

The journal is used to provide crash consistency by recording intended changes before they are committed to the main file system. This structure provides an interface for reading from and writing to the journal region of the disk.

Fields§

§ffs: &'a FastFileSystemInner

A reference to the file system.

Implementations§

Source§

impl JournalIO<'_>

Source

pub fn write_metadata_block( &self, lba: LogicalBlockAddress, block: &[u8; 4096], ) -> Result<(), KernelError>

Writes a metadata block into the journal.

This function records a 4 KiB block of metadata at the specified logical block address (LBA) in the journal. The block is stored as part of the write-ahead log, ensuring that metadata updates can be safely replayed in case of a crash.

Source

pub fn read_journal( &self, lba: LogicalBlockAddress, b: &mut [u8; 4096], ) -> Result<(), KernelError>

Reads a journal block from the disk.

This function retrieves a 4 KiB block from the journal at the given logical block address (LBA) and copies it into the provided buffer. It is primarily used during recovery to replay logged operations and restore the file system to a consistent state.

Auto Trait Implementations§

§

impl<'a> Freeze for JournalIO<'a>

§

impl<'a> !RefUnwindSafe for JournalIO<'a>

§

impl<'a> Send for JournalIO<'a>

§

impl<'a> Sync for JournalIO<'a>

§

impl<'a> Unpin for JournalIO<'a>

§

impl<'a> !UnwindSafe for JournalIO<'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<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.