Skip to content

Commit

Permalink
expose fs::flush()
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Feb 11, 2024
1 parent 5fa51f6 commit 52bcbc0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,14 @@ impl<IO: ReadWriteSeek, TP, OCC> FileSystem<IO, TP, OCC> {
///
/// `Error::Io` will be returned if the underlying storage object returned an I/O error.
pub async fn unmount(self) -> Result<(), Error<IO::Error>> {
self.unmount_internal().await
self.flush().await
}

async fn unmount_internal(&self) -> Result<(), Error<IO::Error>> {
/// Flushes any in memory state to the filesystem
///
/// Updates the FS Information Sector if needed and clears
/// the dirty flag.
pub async fn flush(&self) -> Result<(), Error<IO::Error>> {
self.flush_fs_info().await?;
self.set_dirty_flag(false).await?;
Ok(())
Expand Down

0 comments on commit 52bcbc0

Please sign in to comment.