diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-20 21:57:51 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-30 15:01:28 -0700 |
commit | 75ab4cb8301adb3a02a96c5c03c837ed941f1bc5 (patch) | |
tree | 30a8db554b044b90a8ba59ca0bac2afb5ddb59d3 /fs/f2fs/gc.c | |
parent | 95dd89730119b97d82f9edc806757cef737703e5 (diff) | |
download | linux-75ab4cb8301adb3a02a96c5c03c837ed941f1bc5.tar.bz2 |
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/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 7bf8392d555f..e88fcf65aa7f 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -694,6 +694,9 @@ int f2fs_gc(struct f2fs_sb_info *sbi) int gc_type = BG_GC; int nfree = 0; int ret = -1; + struct cp_control cpc = { + .reason = CP_SYNC, + }; INIT_LIST_HEAD(&ilist); gc_more: @@ -704,7 +707,7 @@ gc_more: if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) { gc_type = FG_GC; - write_checkpoint(sbi, false); + write_checkpoint(sbi, &cpc); } if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE)) @@ -729,7 +732,7 @@ gc_more: goto gc_more; if (gc_type == FG_GC) - write_checkpoint(sbi, false); + write_checkpoint(sbi, &cpc); stop: mutex_unlock(&sbi->gc_mutex); |