diff options
-rw-r--r-- | Documentation/filesystems/btrfs.txt | 8 | ||||
-rw-r--r-- | fs/btrfs/super.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt index ce487a2a88f8..e87609a4e21c 100644 --- a/Documentation/filesystems/btrfs.txt +++ b/Documentation/filesystems/btrfs.txt | |||
@@ -46,10 +46,12 @@ Options with (*) are default options and will not show in the mount options. | |||
46 | bytes, optionally with a K, M, or G suffix, case insensitive. | 46 | bytes, optionally with a K, M, or G suffix, case insensitive. |
47 | Default is 1MB. | 47 | Default is 1MB. |
48 | 48 | ||
49 | noautodefrag(*) | ||
49 | autodefrag | 50 | autodefrag |
50 | Detect small random writes into files and queue them up for the | 51 | Disable/enable auto defragmentation. |
51 | defrag process. Works best for small files; Not well suited for | 52 | Auto defragmentation detects small random writes into files and queue |
52 | large database workloads. | 53 | them up for the defrag process. Works best for small files; |
54 | Not well suited for large database workloads. | ||
53 | 55 | ||
54 | check_int | 56 | check_int |
55 | check_int_data | 57 | check_int_data |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index b02d25a64b2e..44513f3fbdc1 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -323,7 +323,7 @@ enum { | |||
323 | Opt_no_space_cache, Opt_recovery, Opt_skip_balance, | 323 | Opt_no_space_cache, Opt_recovery, Opt_skip_balance, |
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, | 326 | Opt_commit_interval, Opt_barrier, Opt_nodefrag, |
327 | Opt_err, | 327 | Opt_err, |
328 | }; | 328 | }; |
329 | 329 | ||
@@ -357,6 +357,7 @@ static match_table_t tokens = { | |||
357 | {Opt_enospc_debug, "enospc_debug"}, | 357 | {Opt_enospc_debug, "enospc_debug"}, |
358 | {Opt_subvolrootid, "subvolrootid=%d"}, | 358 | {Opt_subvolrootid, "subvolrootid=%d"}, |
359 | {Opt_defrag, "autodefrag"}, | 359 | {Opt_defrag, "autodefrag"}, |
360 | {Opt_nodefrag, "noautodefrag"}, | ||
360 | {Opt_inode_cache, "inode_cache"}, | 361 | {Opt_inode_cache, "inode_cache"}, |
361 | {Opt_no_space_cache, "nospace_cache"}, | 362 | {Opt_no_space_cache, "nospace_cache"}, |
362 | {Opt_recovery, "recovery"}, | 363 | {Opt_recovery, "recovery"}, |
@@ -602,6 +603,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
602 | btrfs_info(root->fs_info, "enabling auto defrag"); | 603 | btrfs_info(root->fs_info, "enabling auto defrag"); |
603 | btrfs_set_opt(info->mount_opt, AUTO_DEFRAG); | 604 | btrfs_set_opt(info->mount_opt, AUTO_DEFRAG); |
604 | break; | 605 | break; |
606 | case Opt_nodefrag: | ||
607 | if (btrfs_test_opt(root, AUTO_DEFRAG)) | ||
608 | btrfs_info(root->fs_info, "disabling auto defrag"); | ||
609 | btrfs_clear_opt(info->mount_opt, AUTO_DEFRAG); | ||
610 | break; | ||
605 | case Opt_recovery: | 611 | case Opt_recovery: |
606 | btrfs_info(root->fs_info, "enabling auto recovery"); | 612 | btrfs_info(root->fs_info, "enabling auto recovery"); |
607 | btrfs_set_opt(info->mount_opt, RECOVERY); | 613 | btrfs_set_opt(info->mount_opt, RECOVERY); |