From 8be8c68eabc2bc148ec1ed43f4bd58cf9321dadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Harabie=C5=84?= Date: Wed, 20 Jun 2018 18:03:12 +0200 Subject: [PATCH] Remove update_fs_info option FSInfo sector should always be saved if it has changed. --- src/fs.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/fs.rs b/src/fs.rs index 0ad8c2e..a20a0bb 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -294,7 +294,6 @@ impl FsInfoSector { #[derive(Copy, Clone, Debug)] pub struct FsOptions { pub(crate) update_accessed_date: bool, - pub(crate) update_fs_info: bool, } impl FsOptions { @@ -302,7 +301,6 @@ impl FsOptions { pub fn new() -> Self { FsOptions { update_accessed_date: false, - update_fs_info: true, } } @@ -311,12 +309,6 @@ impl FsOptions { self.update_accessed_date = enabled; self } - - /// If enabled library updates FSInfo sector when unmounting (only if modified). - pub fn update_fs_info(mut self, enabled: bool) -> Self { - self.update_fs_info = enabled; - self - } } /// FAT volume statistics. @@ -569,15 +561,13 @@ impl FileSystem { /// Unmounts the filesystem. /// - /// Updates FSInfo sector if `update_fs_info` mount option is enabled. + /// Updates FSInfo sector if needed. pub fn unmount(self) -> io::Result<()> { self.unmount_internal() } fn unmount_internal(&self) -> io::Result<()> { - if self.options.update_fs_info { - self.flush_fs_info()?; - } + self.flush_fs_info()?; Ok(()) }