mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 03:13:23 +00:00
Implement sync for ext2 and exfat
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
32572e22d9
commit
300403e3eb
@ -1683,6 +1683,8 @@ impl Inode for ExfatInode {
|
|||||||
let fs_guard = fs.lock();
|
let fs_guard = fs.lock();
|
||||||
inner.sync_all(&fs_guard)?;
|
inner.sync_all(&fs_guard)?;
|
||||||
|
|
||||||
|
fs.block_device().sync()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1692,6 +1694,8 @@ impl Inode for ExfatInode {
|
|||||||
let fs_guard = fs.lock();
|
let fs_guard = fs.lock();
|
||||||
inner.sync_data(&fs_guard)?;
|
inner.sync_data(&fs_guard)?;
|
||||||
|
|
||||||
|
fs.block_device().sync()?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,11 +191,15 @@ impl Inode for Ext2Inode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn sync_all(&self) -> Result<()> {
|
fn sync_all(&self) -> Result<()> {
|
||||||
self.sync_all()
|
self.sync_all()?;
|
||||||
|
self.fs().block_device().sync()?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sync_data(&self) -> Result<()> {
|
fn sync_data(&self) -> Result<()> {
|
||||||
self.sync_data()
|
self.sync_data()?;
|
||||||
|
self.fs().block_device().sync()?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fs(&self) -> Arc<dyn FileSystem> {
|
fn fs(&self) -> Arc<dyn FileSystem> {
|
||||||
|
Reference in New Issue
Block a user