aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/filesystems/f2fs.txt3
-rw-r--r--fs/f2fs/f2fs.h1
-rw-r--r--fs/f2fs/file.c2
-rw-r--r--fs/f2fs/gc.c6
-rw-r--r--fs/f2fs/super.c13
5 files changed, 19 insertions, 6 deletions
diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt
index 4bb9f278c031..e0950c483c22 100644
--- a/Documentation/filesystems/f2fs.txt
+++ b/Documentation/filesystems/f2fs.txt
@@ -135,6 +135,9 @@ nobarrier This option can be used if underlying storage guarantees
135 If this option is set, no cache_flush commands are issued 135 If this option is set, no cache_flush commands are issued
136 but f2fs still guarantees the write ordering of all the 136 but f2fs still guarantees the write ordering of all the
137 data writes. 137 data writes.
138fastboot This option is used when a system wants to reduce mount
139 time as much as possible, even though normal performance
140 can be sacrificed.
138 141
139================================================================================ 142================================================================================
140DEBUGFS ENTRIES 143DEBUGFS ENTRIES
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 5a9705842f10..d45f3f4d7f93 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -49,6 +49,7 @@
49#define F2FS_MOUNT_INLINE_DENTRY 0x00000200 49#define F2FS_MOUNT_INLINE_DENTRY 0x00000200
50#define F2FS_MOUNT_FLUSH_MERGE 0x00000400 50#define F2FS_MOUNT_FLUSH_MERGE 0x00000400
51#define F2FS_MOUNT_NOBARRIER 0x00000800 51#define F2FS_MOUNT_NOBARRIER 0x00000800
52#define F2FS_MOUNT_FASTBOOT 0x00001000
52 53
53#define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) 54#define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)
54#define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) 55#define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 832bd91922b8..46311e7b388a 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -130,6 +130,8 @@ static inline bool need_do_checkpoint(struct inode *inode)
130 need_cp = true; 130 need_cp = true;
131 else if (F2FS_I(inode)->xattr_ver == cur_cp_version(F2FS_CKPT(sbi))) 131 else if (F2FS_I(inode)->xattr_ver == cur_cp_version(F2FS_CKPT(sbi)))
132 need_cp = true; 132 need_cp = true;
133 else if (test_opt(sbi, FASTBOOT))
134 need_cp = true;
133 135
134 return need_cp; 136 return need_cp;
135} 137}
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 7151d7de7d95..b197a2f2993a 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -695,9 +695,9 @@ int f2fs_gc(struct f2fs_sb_info *sbi)
695 int gc_type = BG_GC; 695 int gc_type = BG_GC;
696 int nfree = 0; 696 int nfree = 0;
697 int ret = -1; 697 int ret = -1;
698 struct cp_control cpc = { 698 struct cp_control cpc;
699 .reason = CP_SYNC, 699
700 }; 700 cpc.reason = test_opt(sbi, FASTBOOT) ? CP_UMOUNT : CP_SYNC;
701 701
702 INIT_LIST_HEAD(&ilist); 702 INIT_LIST_HEAD(&ilist);
703gc_more: 703gc_more:
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;