summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-04-30 22:37:50 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-05-28 15:41:39 -0700
commita66cdd985532e69999b79249cd3b4a6bccd0f84b (patch)
treef031e26f195e77b8e49e37a86dbf96af5436b6f0 /fs/f2fs/checkpoint.c
parentd6c67a4fee866ad95fe1d727f80a56f956737706 (diff)
downloadop-kernel-dev-a66cdd985532e69999b79249cd3b4a6bccd0f84b.zip
op-kernel-dev-a66cdd985532e69999b79249cd3b4a6bccd0f84b.tar.gz
f2fs: introduce discard_map for f2fs_trim_fs
This patch adds a bitmap for discard issues from f2fs_trim_fs. There-in rule is to issue discard commands only for invalidated blocks after mount. Once mount is done, f2fs_trim_fs trims out whole invalid area. After ehn, it will not issue and discrads redundantly. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index d076e7e..55b65e5 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1058,7 +1058,8 @@ void write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
mutex_lock(&sbi->cp_mutex);
if (!is_sbi_flag_set(sbi, SBI_IS_DIRTY) &&
- (cpc->reason == CP_FASTBOOT || cpc->reason == CP_SYNC))
+ (cpc->reason == CP_FASTBOOT || cpc->reason == CP_SYNC ||
+ (cpc->reason == CP_DISCARD && !sbi->discard_blks)))
goto out;
if (unlikely(f2fs_cp_error(sbi)))
goto out;
OpenPOWER on IntegriCloud