aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-09-21 01:06:39 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-09-30 18:06:09 -0400
commit4b2fecc84655055a6a1fe9151786992ac04b56ce (patch)
tree05f5f041260756216c0b3f1a0da2360be31580b6 /fs/f2fs/checkpoint.c
parent75ab4cb8301adb3a02a96c5c03c837ed941f1bc5 (diff)
f2fs: introduce FITRIM in f2fs_ioctl
This patch introduces FITRIM in f2fs_ioctl. In this case, f2fs will issue small discards and prefree discards as many as possible for the given area. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index efc530cb74a9..4abf0ba01525 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -997,7 +997,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
997 997
998 mutex_lock(&sbi->cp_mutex); 998 mutex_lock(&sbi->cp_mutex);
999 999
1000 if (!sbi->s_dirty) 1000 if (!sbi->s_dirty && cpc->reason != CP_DISCARD)
1001 goto out; 1001 goto out;
1002 if (unlikely(f2fs_cp_error(sbi))) 1002 if (unlikely(f2fs_cp_error(sbi)))
1003 goto out; 1003 goto out;
@@ -1020,7 +1020,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
1020 1020
1021 /* write cached NAT/SIT entries to NAT/SIT area */ 1021 /* write cached NAT/SIT entries to NAT/SIT area */
1022 flush_nat_entries(sbi); 1022 flush_nat_entries(sbi);
1023 flush_sit_entries(sbi); 1023 flush_sit_entries(sbi, cpc);
1024 1024
1025 /* unlock all the fs_lock[] in do_checkpoint() */ 1025 /* unlock all the fs_lock[] in do_checkpoint() */
1026 do_checkpoint(sbi, cpc); 1026 do_checkpoint(sbi, cpc);