summaryrefslogtreecommitdiffstats
path: root/fs/ext4/fast_commit.c
diff options
context:
space:
mode:
authorYe Bin <yebin10@huawei.com>2022-09-16 10:38:36 +0200
committerTheodore Ts'o <tytso@mit.edu>2022-10-01 05:46:52 +0200
commite64e6ca90913b0dfe14bf7d529df0753a6746e23 (patch)
tree4e0ac15518808418b48ad00ff925ce0af3f5b90f /fs/ext4/fast_commit.c
parentext4: factor out ext4_fc_disabled() (diff)
downloadlinux-e64e6ca90913b0dfe14bf7d529df0753a6746e23.tar.xz
linux-e64e6ca90913b0dfe14bf7d529df0753a6746e23.zip
ext4: adjust fast commit disable judgement order in ext4_fc_track_inode
If fastcommit is already disabled, there isn't need to mark inode ineligible. So move 'ext4_fc_disabled()' judgement bofore 'ext4_should_journal_data(inode)' judgement which can avoid to do meaningless judgement. Signed-off-by: Ye Bin <yebin10@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20220916083836.388347-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r--fs/ext4/fast_commit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index eadab945b856..9217a588afd1 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -577,15 +577,15 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
if (S_ISDIR(inode->i_mode))
return;
+ if (ext4_fc_disabled(inode->i_sb))
+ return;
+
if (ext4_should_journal_data(inode)) {
ext4_fc_mark_ineligible(inode->i_sb,
EXT4_FC_REASON_INODE_JOURNAL_DATA, handle);
return;
}
- if (ext4_fc_disabled(inode->i_sb))
- return;
-
if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE))
return;