summaryrefslogtreecommitdiff
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-07-27 13:15:13 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2018-08-01 21:52:36 +0300
commit18767e62639622554c3642a6e3f3b0ca19bc1d9d (patch)
treeb9a84ce11925d429281a29d17b430a216dd3fb6a /fs/f2fs/checkpoint.c
parent4ddc1b28aac57a90c6426d55e0dea3c1b5eb4782 (diff)
downloadlinux-18767e62639622554c3642a6e3f3b0ca19bc1d9d.tar.xz
f2fs: don't keep meta pages used for block migration
For migration of encrypted inode's block, we load data of encrypted block into meta inode's page cache, after checkpoint, those all intermediate pages should be clean, and no one will read them again, so let's just release them for more memory. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 3f11b3abd766..1425aced91ec 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1408,6 +1408,14 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
commit_checkpoint(sbi, ckpt, start_blk);
wait_on_all_pages_writeback(sbi);
+ /*
+ * invalidate intermediate page cache borrowed from meta inode
+ * which are used for migration of encrypted inode's blocks.
+ */
+ if (f2fs_sb_has_encrypt(sbi->sb))
+ invalidate_mapping_pages(META_MAPPING(sbi),
+ MAIN_BLKADDR(sbi), MAX_BLKADDR(sbi) - 1);
+
f2fs_release_ino_entry(sbi, false);
clear_sbi_flag(sbi, SBI_IS_DIRTY);