diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2014-01-05 20:58:29 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 16:20:18 -0500 |
commit | 2c9ee85671f66cd3ffc7067de47cc59ed6677299 (patch) | |
tree | 38fbbdeeab9950c89d37e52eca4715949040efa6 | |
parent | 530362934332e4efac81d40583aa1225e64f556f (diff) |
btrfs: Add noflushoncommit mount option.
Add noflushoncommit mount option to disable flush on commit with
remount option.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r-- | Documentation/filesystems/btrfs.txt | 1 | ||||
-rw-r--r-- | fs/btrfs/super.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt index 13a7cac80430..303b49c6c296 100644 --- a/Documentation/filesystems/btrfs.txt +++ b/Documentation/filesystems/btrfs.txt | |||
@@ -117,6 +117,7 @@ Options with (*) are default options and will not show in the mount options. | |||
117 | "bug" - BUG() on a fatal error. This is the default. | 117 | "bug" - BUG() on a fatal error. This is the default. |
118 | "panic" - panic() on a fatal error. | 118 | "panic" - panic() on a fatal error. |
119 | 119 | ||
120 | noflushoncommit(*) | ||
120 | flushoncommit | 121 | flushoncommit |
121 | The 'flushoncommit' mount option forces any data dirtied by a write in a | 122 | The 'flushoncommit' mount option forces any data dirtied by a write in a |
122 | prior transaction to commit as part of the current commit. This makes | 123 | prior transaction to commit as part of the current commit. This makes |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 832540645c20..98a682340935 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -324,7 +324,7 @@ enum { | |||
324 | Opt_check_integrity, Opt_check_integrity_including_extent_data, | 324 | Opt_check_integrity, Opt_check_integrity_including_extent_data, |
325 | Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree, | 325 | Opt_check_integrity_print_mask, Opt_fatal_errors, Opt_rescan_uuid_tree, |
326 | Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nodiscard, | 326 | Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nodiscard, |
327 | Opt_noenospc_debug, | 327 | Opt_noenospc_debug, Opt_noflushoncommit, |
328 | Opt_err, | 328 | Opt_err, |
329 | }; | 329 | }; |
330 | 330 | ||
@@ -350,6 +350,7 @@ static match_table_t tokens = { | |||
350 | {Opt_noacl, "noacl"}, | 350 | {Opt_noacl, "noacl"}, |
351 | {Opt_notreelog, "notreelog"}, | 351 | {Opt_notreelog, "notreelog"}, |
352 | {Opt_flushoncommit, "flushoncommit"}, | 352 | {Opt_flushoncommit, "flushoncommit"}, |
353 | {Opt_noflushoncommit, "noflushoncommit"}, | ||
353 | {Opt_ratio, "metadata_ratio=%d"}, | 354 | {Opt_ratio, "metadata_ratio=%d"}, |
354 | {Opt_discard, "discard"}, | 355 | {Opt_discard, "discard"}, |
355 | {Opt_nodiscard, "nodiscard"}, | 356 | {Opt_nodiscard, "nodiscard"}, |
@@ -562,6 +563,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
562 | btrfs_info(root->fs_info, "turning on flush-on-commit"); | 563 | btrfs_info(root->fs_info, "turning on flush-on-commit"); |
563 | btrfs_set_opt(info->mount_opt, FLUSHONCOMMIT); | 564 | btrfs_set_opt(info->mount_opt, FLUSHONCOMMIT); |
564 | break; | 565 | break; |
566 | case Opt_noflushoncommit: | ||
567 | if (btrfs_test_opt(root, FLUSHONCOMMIT)) | ||
568 | btrfs_info(root->fs_info, "turning off flush-on-commit"); | ||
569 | btrfs_clear_opt(info->mount_opt, FLUSHONCOMMIT); | ||
570 | break; | ||
565 | case Opt_ratio: | 571 | case Opt_ratio: |
566 | ret = match_int(&args[0], &intarg); | 572 | ret = match_int(&args[0], &intarg); |
567 | if (ret) { | 573 | if (ret) { |