summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-01-16 14:23:38 +0400
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-03-27 16:59:19 +0400
commit625602487a03203a732dc0d4b63da895f45def86 (patch)
treec311740ba31e43c599b7418e3112ca15469cea43 /fs
parent1842fbc8d25e629e54080fe3c5928d4ce8ccf55a (diff)
downloadlinux-next-625602487a03203a732dc0d4b63da895f45def86.tar.gz
fs/ntfs3: Optimization in ntfs_set_state()
The current volume flags are updated only if VOLUME_FLAG_DIRTY has been changed. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs3/fsntfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
index 342938704cfd..d888ba14237f 100644
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -925,6 +925,7 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum NTFS_DIRTY_FLAGS dirty)
struct VOLUME_INFO *info;
struct mft_inode *mi;
struct ntfs_inode *ni;
+ __le16 info_flags;
/*
* Do not change state if fs was real_dirty.
@@ -957,6 +958,8 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum NTFS_DIRTY_FLAGS dirty)
goto out;
}
+ info_flags = info->flags;
+
switch (dirty) {
case NTFS_DIRTY_ERROR:
ntfs_notice(sbi->sb, "Mark volume as dirty due to NTFS errors");
@@ -970,8 +973,10 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum NTFS_DIRTY_FLAGS dirty)
break;
}
/* Cache current volume flags. */
- sbi->volume.flags = info->flags;
- mi->dirty = true;
+ if (info_flags != info->flags) {
+ sbi->volume.flags = info->flags;
+ mi->dirty = true;
+ }
err = 0;
out: