Skip to main content

Jbd2Dev

Struct Jbd2Dev 

Source
pub struct Jbd2Dev<B: BlockDevice> { /* private fields */ }
Expand description

Block device proxy that optionally routes metadata writes through JBD2.

Implementations§

Source§

impl<B: BlockDevice> Jbd2Dev<B>

Source

pub fn initial_jbd2dev(_mode: u8, block_dev: B, use_journal: bool) -> Self

Creates a new JBD2 block device proxy.

Source

pub fn is_use_journal(&self) -> bool

Returns whether journal support is enabled.

Source

pub fn journal_sequence(&self) -> Option<u32>

Returns the current journal transaction sequence if journal is active.

Source

pub fn journal_replay(&mut self)

Replays the journal if the proxy is configured to use it.

Source

pub fn set_journal_use(&mut self, use_journal: bool)

Enables or disables journal use at runtime.

Source

pub fn set_journal_superblock( &mut self, super_block: JournalSuperBllockS, journal_start_block: AbsoluteBN, )

Installs the journal superblock so JBD2 state can be initialized lazily.

Source

pub fn umount_commit(&mut self)

Commits all buffered journal transactions during unmount.

Source

pub fn write_block( &mut self, block_id: AbsoluteBN, is_metadata: bool, ) -> Ext4Result<()>

Writes the current internal block buffer.

Source

pub fn read_block(&mut self, block_id: AbsoluteBN) -> Ext4Result<()>

Reads one block through the cached inner device.

Source

pub fn buffer(&self) -> &[u8]

Returns the cached block buffer.

Source

pub fn buffer_mut(&mut self) -> &mut [u8]

Returns the cached block buffer mutably.

Source

pub fn read_blocks( &mut self, buf: &mut [u8], block_id: AbsoluteBN, count: u32, ) -> Ext4Result<()>

Reads multiple blocks directly.

Source

pub fn write_blocks( &mut self, buf: &[u8], block_id: AbsoluteBN, count: u32, is_metadata: bool, ) -> Ext4Result<()>

Writes multiple blocks, optionally journaling metadata buffers.

Source

pub fn cantflush(&mut self) -> Ext4Result<()>

Flushes the inner cached device.

Source

pub fn total_blocks(&self) -> u64

Returns the total number of device blocks.

Source

pub fn block_size(&self) -> u32

Returns the underlying device block size.

Source

pub fn current_time(&self) -> Ext4Result<Ext4Timestamp>

Returns the current timestamp from the underlying device.

Auto Trait Implementations§

§

impl<B> Freeze for Jbd2Dev<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for Jbd2Dev<B>
where B: RefUnwindSafe,

§

impl<B> Send for Jbd2Dev<B>
where B: Send,

§

impl<B> Sync for Jbd2Dev<B>
where B: Sync,

§

impl<B> Unpin for Jbd2Dev<B>
where B: Unpin,

§

impl<B> UnsafeUnpin for Jbd2Dev<B>
where B: UnsafeUnpin,

§

impl<B> UnwindSafe for Jbd2Dev<B>
where B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.