diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-21 00:57:51 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-30 18:01:28 -0400 |
commit | 75ab4cb8301adb3a02a96c5c03c837ed941f1bc5 (patch) | |
tree | 30a8db554b044b90a8ba59ca0bac2afb5ddb59d3 /fs/f2fs/gc.c | |
parent | 95dd89730119b97d82f9edc806757cef737703e5 (diff) |
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) | |||
694 | int gc_type = BG_GC; | 694 | int gc_type = BG_GC; |
695 | int nfree = 0; | 695 | int nfree = 0; |
696 | int ret = -1; | 696 | int ret = -1; |
697 | struct cp_control cpc = { | ||
698 | .reason = CP_SYNC, | ||
699 | }; | ||
697 | 700 | ||
698 | INIT_LIST_HEAD(&ilist); | 701 | INIT_LIST_HEAD(&ilist); |
699 | gc_more: | 702 | gc_more: |
@@ -704,7 +707,7 @@ gc_more: | |||
704 | 707 | ||
705 | if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) { | 708 | if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) { |
706 | gc_type = FG_GC; | 709 | gc_type = FG_GC; |
707 | write_checkpoint(sbi, false); | 710 | write_checkpoint(sbi, &cpc); |
708 | } | 711 | } |
709 | 712 | ||
710 | if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE)) | 713 | if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE)) |
@@ -729,7 +732,7 @@ gc_more: | |||
729 | goto gc_more; | 732 | goto gc_more; |
730 | 733 | ||
731 | if (gc_type == FG_GC) | 734 | if (gc_type == FG_GC) |
732 | write_checkpoint(sbi, false); | 735 | write_checkpoint(sbi, &cpc); |
733 | stop: | 736 | stop: |
734 | mutex_unlock(&sbi->gc_mutex); | 737 | mutex_unlock(&sbi->gc_mutex); |
735 | 738 | ||