@ -165,6 +165,13 @@ impl vfs::INode for INodeImpl {
blk_size: 0x1000,
})
}
fn chmod(&self, mode: u16) -> vfs::Result<()> {
let mut disk_inode = self.disk_inode.write();
disk_inode.mode = mode;
Ok(())
fn sync_all(&self) -> vfs::Result<()> {
if disk_inode.dirty() {
@ -307,6 +307,12 @@ impl vfs::INode for INodeImpl {
blk_size: BLKSIZE,
// No-op for sfs
@ -9,6 +9,7 @@ pub trait INode: Any + Sync + Send {
fn read_at(&self, offset: usize, buf: &mut [u8]) -> Result<usize>;
fn write_at(&self, offset: usize, buf: &[u8]) -> Result<usize>;
fn metadata(&self) -> Result<Metadata>;
fn chmod(&self, mode: u16) -> Result<()>;
/// Sync all data and metadata
fn sync_all(&self) -> Result<()>;
/// Sync data (not include metadata)