summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-10-04 11:15:18 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-10-16 09:36:59 -0700
commited15ba14155962c328ceb69712164aea8c444a82 (patch)
tree663bb1f9ae24ca014b76b767b155ffe7cb899237 /fs
parent4dada3fd7025e9dbc56c93d9996cba6e47915c62 (diff)
downloadlinux-stable-ed15ba14155962c328ceb69712164aea8c444a82.tar.gz
linux-stable-ed15ba14155962c328ceb69712164aea8c444a82.tar.bz2
linux-stable-ed15ba14155962c328ceb69712164aea8c444a82.zip
f2fs: shrink sbi->sb_lock coverage in set_file_temperature()
file_set_{cold,hot} doesn't need holding sbi->sb_lock, so moving them out of the lock. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/namei.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index a14632744a6a..d5de8a99532d 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -182,16 +182,19 @@ static inline void set_file_temperature(struct f2fs_sb_info *sbi, struct inode *
hot_count = sbi->raw_super->hot_ext_count;
for (i = 0; i < cold_count + hot_count; i++) {
- if (!is_extension_exist(name, extlist[i]))
- continue;
- if (i < cold_count)
- file_set_cold(inode);
- else
- file_set_hot(inode);
- break;
+ if (is_extension_exist(name, extlist[i]))
+ break;
}
up_read(&sbi->sb_lock);
+
+ if (i == cold_count + hot_count)
+ return;
+
+ if (i < cold_count)
+ file_set_cold(inode);
+ else
+ file_set_hot(inode);
}
int f2fs_update_extension_list(struct f2fs_sb_info *sbi, const char *name,