Implement sync for ext2 and exfat

This commit is contained in:
Cautreoxit
2024-10-28 22:02:22 +08:00
committed by Tate, Hongliang Tian
parent 32572e22d9
commit 300403e3eb
2 changed files with 10 additions and 2 deletions

View File

@ -1683,6 +1683,8 @@ impl Inode for ExfatInode {
let fs_guard = fs.lock();
inner.sync_all(&fs_guard)?;
fs.block_device().sync()?;
Ok(())
}
@ -1692,6 +1694,8 @@ impl Inode for ExfatInode {
let fs_guard = fs.lock();
inner.sync_data(&fs_guard)?;
fs.block_device().sync()?;
Ok(())
}

View File

@ -191,11 +191,15 @@ impl Inode for Ext2Inode {
}
fn sync_all(&self) -> Result<()> {
self.sync_all()
self.sync_all()?;
self.fs().block_device().sync()?;
Ok(())
}
fn sync_data(&self) -> Result<()> {
self.sync_data()
self.sync_data()?;
self.fs().block_device().sync()?;
Ok(())
}
fn fs(&self) -> Arc<dyn FileSystem> {