diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-05 14:49:57 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-09 16:20:57 -0700 |
commit | 60b99b486b568c13cbb7caa83cf8a12af7665f1e (patch) | |
tree | c766ac4adddb9e115455ae29d141d5b94a7a677d /fs/f2fs/segment.c | |
parent | 5c2674347466d5c2d5169214e95f4ad6dc09e9b6 (diff) | |
download | talos-obmc-linux-60b99b486b568c13cbb7caa83cf8a12af7665f1e.tar.gz talos-obmc-linux-60b99b486b568c13cbb7caa83cf8a12af7665f1e.zip |
f2fs: introduce a periodic checkpoint flow
This patch introduces a periodic checkpoint feature.
Note that, this is not enforcing to conduct checkpoints very strictly in terms
of trigger timing, instead just hope to help user experiences.
The default value is 60 seconds.
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6b8edf21a152..1d86a35ae9fe 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -15,6 +15,7 @@ #include <linux/prefetch.h> #include <linux/kthread.h> #include <linux/swap.h> +#include <linux/timer.h> #include "f2fs.h" #include "segment.h" @@ -315,7 +316,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) /* checkpoint is the only way to shrink partial cached entries */ if (!available_free_memory(sbi, NAT_ENTRIES) || excess_prefree_segs(sbi) || - !available_free_memory(sbi, INO_ENTRIES)) + !available_free_memory(sbi, INO_ENTRIES) || + jiffies > sbi->cp_expires) f2fs_sync_fs(sbi->sb, true); } |