mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 02:43:24 +00:00
Add Ext2 fs and basic bio layer
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
1616f2d32c
commit
9473889c6b
@ -1,4 +1,3 @@
|
||||
use aster_frame::vm::VmFrame;
|
||||
use core::time::Duration;
|
||||
|
||||
use crate::fs::utils::{FileSystem, Inode, InodeMode, InodeType, IoctlCmd, Metadata};
|
||||
@ -31,12 +30,18 @@ impl<F: FileOps + 'static> Inode for ProcFile<F> {
|
||||
self.info.size()
|
||||
}
|
||||
|
||||
fn resize(&self, _new_size: usize) {}
|
||||
fn resize(&self, _new_size: usize) -> Result<()> {
|
||||
Err(Error::new(Errno::EPERM))
|
||||
}
|
||||
|
||||
fn metadata(&self) -> Metadata {
|
||||
self.info.metadata()
|
||||
}
|
||||
|
||||
fn ino(&self) -> u64 {
|
||||
self.info.ino()
|
||||
}
|
||||
|
||||
fn type_(&self) -> InodeType {
|
||||
InodeType::File
|
||||
}
|
||||
@ -65,14 +70,6 @@ impl<F: FileOps + 'static> Inode for ProcFile<F> {
|
||||
self.info.set_mtime(time)
|
||||
}
|
||||
|
||||
fn read_page(&self, _idx: usize, _frame: &VmFrame) -> Result<()> {
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
fn write_page(&self, _idx: usize, _frame: &VmFrame) -> Result<()> {
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
fn read_at(&self, offset: usize, buf: &mut [u8]) -> Result<usize> {
|
||||
let data = self.inner.data()?;
|
||||
let start = data.len().min(offset);
|
||||
|
Reference in New Issue
Block a user