Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1be4c686 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent fab12a08
Loading
Loading
Loading
Loading
+10 −7
Original line number Original line Diff line number Diff line
@@ -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;
	hot_count = sbi->raw_super->hot_ext_count;


	for (i = 0; i < cold_count + hot_count; i++) {
	for (i = 0; i < cold_count + hot_count; i++) {
		if (!is_extension_exist(name, extlist[i]))
		if (is_extension_exist(name, extlist[i]))
			continue;
		if (i < cold_count)
			file_set_cold(inode);
		else
			file_set_hot(inode);
			break;
			break;
	}
	}


	up_read(&sbi->sb_lock);
	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,
int f2fs_update_extension_list(struct f2fs_sb_info *sbi, const char *name,