aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-10-31 01:47:03 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-11-04 20:34:15 -0500
commitd5053a34a9cc797b9d5d77574354b5555848c43c (patch)
tree86e6e101b812f6d2500b46bf1cd567aa9c8b33c6 /fs/f2fs/super.c
parentbe138b7b0d4cbfb8a927d9bc333ceffee9908c23 (diff)
f2fs: introduce -o fastboot for reducing booting time only
If a system wants to reduce the booting time as a top priority, now we can use a mount option, -o fastboot. With this option, f2fs conducts a little bit slow write_checkpoint, but it can avoid the node page reads during the next mount time. 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 6c5fc7605109..512ffd8e1624 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -54,6 +54,7 @@ enum {
54 Opt_inline_dentry, 54 Opt_inline_dentry,
55 Opt_flush_merge, 55 Opt_flush_merge,
56 Opt_nobarrier, 56 Opt_nobarrier,
57 Opt_fastboot,
57 Opt_err, 58 Opt_err,
58}; 59};
59 60
@@ -73,6 +74,7 @@ static match_table_t f2fs_tokens = {
73 {Opt_inline_dentry, "inline_dentry"}, 74 {Opt_inline_dentry, "inline_dentry"},
74 {Opt_flush_merge, "flush_merge"}, 75 {Opt_flush_merge, "flush_merge"},
75 {Opt_nobarrier, "nobarrier"}, 76 {Opt_nobarrier, "nobarrier"},
77 {Opt_fastboot, "fastboot"},
76 {Opt_err, NULL}, 78 {Opt_err, NULL},
77}; 79};
78 80
@@ -351,6 +353,9 @@ static int parse_options(struct super_block *sb, char *options)
351 case Opt_nobarrier: 353 case Opt_nobarrier:
352 set_opt(sbi, NOBARRIER); 354 set_opt(sbi, NOBARRIER);
353 break; 355 break;
356 case Opt_fastboot:
357 set_opt(sbi, FASTBOOT);
358 break;
354 default: 359 default:
355 f2fs_msg(sb, KERN_ERR, 360 f2fs_msg(sb, KERN_ERR,
356 "Unrecognized mount option \"%s\" or missing value", 361 "Unrecognized mount option \"%s\" or missing value",
@@ -479,9 +484,9 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
479 trace_f2fs_sync_fs(sb, sync); 484 trace_f2fs_sync_fs(sb, sync);
480 485
481 if (sync) { 486 if (sync) {
482 struct cp_control cpc = { 487 struct cp_control cpc;
483 .reason = CP_SYNC, 488
484 }; 489 cpc.reason = test_opt(sbi, FASTBOOT) ? CP_UMOUNT : CP_SYNC;
485 mutex_lock(&sbi->gc_mutex); 490 mutex_lock(&sbi->gc_mutex);
486 write_checkpoint(sbi, &cpc); 491 write_checkpoint(sbi, &cpc);
487 mutex_unlock(&sbi->gc_mutex); 492 mutex_unlock(&sbi->gc_mutex);
@@ -574,6 +579,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
574 seq_puts(seq, ",flush_merge"); 579 seq_puts(seq, ",flush_merge");
575 if (test_opt(sbi, NOBARRIER)) 580 if (test_opt(sbi, NOBARRIER))
576 seq_puts(seq, ",nobarrier"); 581 seq_puts(seq, ",nobarrier");
582 if (test_opt(sbi, FASTBOOT))
583 seq_puts(seq, ",fastboot");
577 seq_printf(seq, ",active_logs=%u", sbi->active_logs); 584 seq_printf(seq, ",active_logs=%u", sbi->active_logs);
578 585
579 return 0; 586 return 0;