diff options
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 5 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 1 | ||||
-rw-r--r-- | fs/f2fs/segment.c | 3 | ||||
-rw-r--r-- | fs/f2fs/super.c | 7 |
4 files changed, 15 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c77c66723d70..482313dd9e24 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -139,7 +139,10 @@ void f2fs_submit_merged_bio(struct f2fs_sb_info *sbi, | |||
139 | /* change META to META_FLUSH in the checkpoint procedure */ | 139 | /* change META to META_FLUSH in the checkpoint procedure */ |
140 | if (type >= META_FLUSH) { | 140 | if (type >= META_FLUSH) { |
141 | io->fio.type = META_FLUSH; | 141 | io->fio.type = META_FLUSH; |
142 | io->fio.rw = WRITE_FLUSH_FUA | REQ_META | REQ_PRIO; | 142 | if (test_opt(sbi, NOBARRIER)) |
143 | io->fio.rw = WRITE_FLUSH | REQ_META | REQ_PRIO; | ||
144 | else | ||
145 | io->fio.rw = WRITE_FLUSH_FUA | REQ_META | REQ_PRIO; | ||
143 | } | 146 | } |
144 | __submit_merged_bio(io); | 147 | __submit_merged_bio(io); |
145 | up_write(&io->io_rwsem); | 148 | up_write(&io->io_rwsem); |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 8f507d4c0f71..e999eec200b7 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #define F2FS_MOUNT_INLINE_XATTR 0x00000080 | 41 | #define F2FS_MOUNT_INLINE_XATTR 0x00000080 |
42 | #define F2FS_MOUNT_INLINE_DATA 0x00000100 | 42 | #define F2FS_MOUNT_INLINE_DATA 0x00000100 |
43 | #define F2FS_MOUNT_FLUSH_MERGE 0x00000200 | 43 | #define F2FS_MOUNT_FLUSH_MERGE 0x00000200 |
44 | #define F2FS_MOUNT_NOBARRIER 0x00000400 | ||
44 | 45 | ||
45 | #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) | 46 | #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option) |
46 | #define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) | 47 | #define set_opt(sbi, option) (sbi->mount_opt.opt |= F2FS_MOUNT_##option) |
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 8a6e57d83c79..9fce0f47eb35 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -239,6 +239,9 @@ int f2fs_issue_flush(struct f2fs_sb_info *sbi) | |||
239 | struct flush_cmd_control *fcc = SM_I(sbi)->cmd_control_info; | 239 | struct flush_cmd_control *fcc = SM_I(sbi)->cmd_control_info; |
240 | struct flush_cmd cmd; | 240 | struct flush_cmd cmd; |
241 | 241 | ||
242 | if (test_opt(sbi, NOBARRIER)) | ||
243 | return 0; | ||
244 | |||
242 | if (!test_opt(sbi, FLUSH_MERGE)) | 245 | if (!test_opt(sbi, FLUSH_MERGE)) |
243 | return blkdev_issue_flush(sbi->sb->s_bdev, GFP_KERNEL, NULL); | 246 | return blkdev_issue_flush(sbi->sb->s_bdev, GFP_KERNEL, NULL); |
244 | 247 | ||
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 34649aa66e04..93593ceec175 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -52,6 +52,7 @@ enum { | |||
52 | Opt_inline_xattr, | 52 | Opt_inline_xattr, |
53 | Opt_inline_data, | 53 | Opt_inline_data, |
54 | Opt_flush_merge, | 54 | Opt_flush_merge, |
55 | Opt_nobarrier, | ||
55 | Opt_err, | 56 | Opt_err, |
56 | }; | 57 | }; |
57 | 58 | ||
@@ -69,6 +70,7 @@ static match_table_t f2fs_tokens = { | |||
69 | {Opt_inline_xattr, "inline_xattr"}, | 70 | {Opt_inline_xattr, "inline_xattr"}, |
70 | {Opt_inline_data, "inline_data"}, | 71 | {Opt_inline_data, "inline_data"}, |
71 | {Opt_flush_merge, "flush_merge"}, | 72 | {Opt_flush_merge, "flush_merge"}, |
73 | {Opt_nobarrier, "nobarrier"}, | ||
72 | {Opt_err, NULL}, | 74 | {Opt_err, NULL}, |
73 | }; | 75 | }; |
74 | 76 | ||
@@ -339,6 +341,9 @@ static int parse_options(struct super_block *sb, char *options) | |||
339 | case Opt_flush_merge: | 341 | case Opt_flush_merge: |
340 | set_opt(sbi, FLUSH_MERGE); | 342 | set_opt(sbi, FLUSH_MERGE); |
341 | break; | 343 | break; |
344 | case Opt_nobarrier: | ||
345 | set_opt(sbi, NOBARRIER); | ||
346 | break; | ||
342 | default: | 347 | default: |
343 | f2fs_msg(sb, KERN_ERR, | 348 | f2fs_msg(sb, KERN_ERR, |
344 | "Unrecognized mount option \"%s\" or missing value", | 349 | "Unrecognized mount option \"%s\" or missing value", |
@@ -544,6 +549,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) | |||
544 | seq_puts(seq, ",inline_data"); | 549 | seq_puts(seq, ",inline_data"); |
545 | if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE)) | 550 | if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE)) |
546 | seq_puts(seq, ",flush_merge"); | 551 | seq_puts(seq, ",flush_merge"); |
552 | if (test_opt(sbi, NOBARRIER)) | ||
553 | seq_puts(seq, ",nobarrier"); | ||
547 | seq_printf(seq, ",active_logs=%u", sbi->active_logs); | 554 | seq_printf(seq, ",active_logs=%u", sbi->active_logs); |
548 | 555 | ||
549 | return 0; | 556 | return 0; |