summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2020-12-26 18:07:41 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2021-01-27 15:20:01 -0800
commit0b979f1bded3e6808184842133e6afeba312a4ff (patch)
treec70ade55462a3431052947af73301f93c73a7738 /fs/f2fs
parente0fcd01510ad025c9bbce704c5c2579294056141 (diff)
downloadlinux-0b979f1bded3e6808184842133e6afeba312a4ff.tar.bz2
f2fs: relocate f2fs_precache_extents()
Relocate f2fs_precache_extents() in prior to check_swap_activate(), then extent cache can be enabled before its use. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/data.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index aa34d620bec9..57b9aab2b142 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -4108,12 +4108,13 @@ static int f2fs_swap_activate(struct swap_info_struct *sis, struct file *file,
if (!f2fs_disable_compressed_file(inode))
return -EINVAL;
+ f2fs_precache_extents(inode);
+
ret = check_swap_activate(sis, file, span);
if (ret < 0)
return ret;
set_inode_flag(inode, FI_PIN_FILE);
- f2fs_precache_extents(inode);
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
return ret;
}