JournalSb

Struct JournalSb 

Source
#[repr(C, packed(1))]
pub struct JournalSb { pub magic: [u8; 8], pub commited: u64, pub tx_id: u64, _pad: [u8; 4072], }
Expand description

Represents the on-disk metadata for the journal superblock.

Fields§

§magic: [u8; 8]

Journal magic: “KeOSJOUR”.

§commited: u64

Indicate journal has been commited.

§tx_id: u64

Transaction id.

§_pad: [u8; 4072]

Padding to fill a full block (4096 bytes).

Implementations§

Source§

impl JournalSb

Source

pub fn from_disk( disk: &Disk, lba: LogicalBlockAddress, ) -> Result<Box<Self>, KernelError>

Loads the journal superblock from disk.

§Arguments
  • disk: The underlying disk interface.
  • lba: The logical block address where the journal superblock is located.
§Returns
  • Ok(Box<Self>): A parsed journal superblock.
  • Err(KernelError): If the block could not be read or parsed.
Source

pub fn writeback( &self, io: &JournalIO<'_>, ffs: &FastFileSystemInner, ) -> Result<(), KernelError>

Writes the current journal superblock to disk.

This updates the on-disk metadata for the journal ring buffer.

§Arguments
  • io: The I/O interface to the journal.
  • ffs: Reference to the file system’s metadata layout.
§Returns
  • Ok(()): If the write succeeds.
  • Err(KernelError): If the write fails.

Trait Implementations§

Source§

impl Default for JournalSb

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for JournalSb

§

impl RefUnwindSafe for JournalSb

§

impl Send for JournalSb

§

impl Sync for JournalSb

§

impl Unpin for JournalSb

§

impl UnwindSafe for JournalSb

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.