Ext4FileSystem

Struct Ext4FileSystem 

Source
pub struct Ext4FileSystem {
    device: Arc<dyn BlockDriver>,
    block_size: usize,
    total_blocks: usize,
    device_id: usize,
    ext4: Arc<Mutex<Ext4>>,
    root: Arc<dyn Inode>,
}
Expand description

Ext4 文件系统

Fields§

§device: Arc<dyn BlockDriver>

底层块设备驱动

§block_size: usize

块大小

§total_blocks: usize

总块数

§device_id: usize

设备 ID

§ext4: Arc<Mutex<Ext4>>

ext4_rs 文件系统对象

§root: Arc<dyn Inode>

根 inode

Implementations§

Source§

impl Ext4FileSystem

Source

pub fn open( device: Arc<dyn BlockDriver>, block_size: usize, total_blocks: usize, device_id: usize, ) -> Result<Arc<Self>, FsError>

打开 Ext4 文件系统

§参数
  • device: 块设备驱动
  • block_size: 块大小
  • total_blocks: 总块数
  • device_id: 设备 ID
§返回

Ext4 文件系统实例

Trait Implementations§

Source§

impl FileSystem for Ext4FileSystem

Source§

fn fs_type(&self) -> &'static str

文件系统类型名称 Read more
Source§

fn root_inode(&self) -> Arc<dyn Inode>

获取根 inode Read more
Source§

fn sync(&self) -> Result<(), FsError>

同步文件系统 Read more
Source§

fn statfs(&self) -> Result<StatFs, FsError>

获取文件系统统计信息
Source§

fn umount(&self) -> Result<(), FsError>

卸载文件系统(可选) Read more

Auto Trait Implementations§

§

impl Freeze for Ext4FileSystem

§

impl !RefUnwindSafe for Ext4FileSystem

§

impl Send for Ext4FileSystem

§

impl Sync for Ext4FileSystem

§

impl Unpin for Ext4FileSystem

§

impl !UnwindSafe for Ext4FileSystem

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.