summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-09-20 21:57:51 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2014-09-30 15:01:28 -0700
commit75ab4cb8301adb3a02a96c5c03c837ed941f1bc5 (patch)
tree30a8db554b044b90a8ba59ca0bac2afb5ddb59d3 /fs/f2fs/super.c
parent95dd89730119b97d82f9edc806757cef737703e5 (diff)
downloadblackbird-op-linux-75ab4cb8301adb3a02a96c5c03c837ed941f1bc5.tar.gz
blackbird-op-linux-75ab4cb8301adb3a02a96c5c03c837ed941f1bc5.zip
f2fs: introduce cp_control structure
This patch add a new data structure to control checkpoint parameters. Currently, it presents the reason of checkpoint such as is_umount and normal sync. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 7a91a381dced..128c42000fa3 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -434,8 +434,12 @@ static void f2fs_put_super(struct super_block *sb)
stop_gc_thread(sbi);
/* We don't need to do checkpoint when it's clean */
- if (sbi->s_dirty)
- write_checkpoint(sbi, true);
+ if (sbi->s_dirty) {
+ struct cp_control cpc = {
+ .reason = CP_UMOUNT,
+ };
+ write_checkpoint(sbi, &cpc);
+ }
/*
* normally superblock is clean, so we need to release this.
@@ -466,8 +470,11 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
trace_f2fs_sync_fs(sb, sync);
if (sync) {
+ struct cp_control cpc = {
+ .reason = CP_SYNC,
+ };
mutex_lock(&sbi->gc_mutex);
- write_checkpoint(sbi, false);
+ write_checkpoint(sbi, &cpc);
mutex_unlock(&sbi->gc_mutex);
} else {
f2fs_balance_fs(sbi);
OpenPOWER on IntegriCloud