btrfs: add a comment to mark the deprecated mount option
[sfrench/cifs-2.6.git] / fs / btrfs / super.c
index 790f3ab600cdc12418861d5a5a276cf01916ac91..540c18511e7a8663065832f9b37574e173207918 100644 (file)
@@ -344,7 +344,7 @@ static const match_table_t tokens = {
        {Opt_nobarrier, "nobarrier"},
        {Opt_barrier, "barrier"},
        {Opt_max_inline, "max_inline=%s"},
-       {Opt_alloc_start, "alloc_start=%s"},
+       {Opt_alloc_start, "alloc_start=%s"},            /* deprecated */
        {Opt_thread_pool, "thread_pool=%u"},
        {Opt_compress, "compress"},
        {Opt_compress_type, "compress=%s"},
@@ -361,7 +361,7 @@ static const match_table_t tokens = {
        {Opt_norecovery, "norecovery"},
        {Opt_flushoncommit, "flushoncommit"},
        {Opt_noflushoncommit, "noflushoncommit"},
-       {Opt_ratio, "metadata_ratio=%d"},
+       {Opt_ratio, "metadata_ratio=%u"},
        {Opt_discard, "discard"},
        {Opt_nodiscard, "nodiscard"},
        {Opt_space_cache, "space_cache"},
@@ -370,7 +370,7 @@ static const match_table_t tokens = {
        {Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"},
        {Opt_enospc_debug, "enospc_debug"},
        {Opt_noenospc_debug, "noenospc_debug"},
-       {Opt_subvolrootid, "subvolrootid=%d"},
+       {Opt_subvolrootid, "subvolrootid=%d"},          /* deprecated */
        {Opt_defrag, "autodefrag"},
        {Opt_nodefrag, "noautodefrag"},
        {Opt_inode_cache, "inode_cache"},
@@ -381,10 +381,10 @@ static const match_table_t tokens = {
        {Opt_skip_balance, "skip_balance"},
        {Opt_check_integrity, "check_int"},
        {Opt_check_integrity_including_extent_data, "check_int_data"},
-       {Opt_check_integrity_print_mask, "check_int_print_mask=%d"},
+       {Opt_check_integrity_print_mask, "check_int_print_mask=%u"},
        {Opt_rescan_uuid_tree, "rescan_uuid_tree"},
        {Opt_fatal_errors, "fatal_errors=%s"},
-       {Opt_commit_interval, "commit=%d"},
+       {Opt_commit_interval, "commit=%u"},
 #ifdef CONFIG_BTRFS_DEBUG
        {Opt_fragment_data, "fragment=data"},
        {Opt_fragment_metadata, "fragment=metadata"},
@@ -657,16 +657,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                        break;
                case Opt_ratio:
                        ret = match_int(&args[0], &intarg);
-                       if (ret) {
-                               goto out;
-                       } else if (intarg >= 0) {
-                               info->metadata_ratio = intarg;
-                               btrfs_info(info, "metadata ratio %d",
-                                          info->metadata_ratio);
-                       } else {
-                               ret = -EINVAL;
+                       if (ret)
                                goto out;
-                       }
+                       info->metadata_ratio = intarg;
+                       btrfs_info(info, "metadata ratio %u",
+                                  info->metadata_ratio);
                        break;
                case Opt_discard:
                        btrfs_set_and_info(info, DISCARD,
@@ -761,17 +756,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                        break;
                case Opt_check_integrity_print_mask:
                        ret = match_int(&args[0], &intarg);
-                       if (ret) {
-                               goto out;
-                       } else if (intarg >= 0) {
-                               info->check_integrity_print_mask = intarg;
-                               btrfs_info(info,
-                                          "check_integrity_print_mask 0x%x",
-                                          info->check_integrity_print_mask);
-                       } else {
-                               ret = -EINVAL;
+                       if (ret)
                                goto out;
-                       }
+                       info->check_integrity_print_mask = intarg;
+                       btrfs_info(info, "check_integrity_print_mask 0x%x",
+                                  info->check_integrity_print_mask);
                        break;
 #else
                case Opt_check_integrity_including_extent_data:
@@ -797,24 +786,18 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                case Opt_commit_interval:
                        intarg = 0;
                        ret = match_int(&args[0], &intarg);
-                       if (ret < 0) {
-                               btrfs_err(info, "invalid commit interval");
-                               ret = -EINVAL;
+                       if (ret)
                                goto out;
-                       }
-                       if (intarg > 0) {
-                               if (intarg > 300) {
-                                       btrfs_warn(info,
-                                               "excessive commit interval %d",
-                                               intarg);
-                               }
-                               info->commit_interval = intarg;
-                       } else {
+                       if (intarg == 0) {
                                btrfs_info(info,
-                                          "using default commit interval %ds",
+                                          "using default commit interval %us",
                                           BTRFS_DEFAULT_COMMIT_INTERVAL);
-                               info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL;
+                               intarg = BTRFS_DEFAULT_COMMIT_INTERVAL;
+                       } else if (intarg > 300) {
+                               btrfs_warn(info, "excessive commit interval %d",
+                                          intarg);
                        }
+                       info->commit_interval = intarg;
                        break;
 #ifdef CONFIG_BTRFS_DEBUG
                case Opt_fragment_all:
@@ -1339,12 +1322,11 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
                                info->check_integrity_print_mask);
 #endif
        if (info->metadata_ratio)
-               seq_printf(seq, ",metadata_ratio=%d",
-                               info->metadata_ratio);
+               seq_printf(seq, ",metadata_ratio=%u", info->metadata_ratio);
        if (btrfs_test_opt(info, PANIC_ON_FATAL_ERROR))
                seq_puts(seq, ",fatal_errors=panic");
        if (info->commit_interval != BTRFS_DEFAULT_COMMIT_INTERVAL)
-               seq_printf(seq, ",commit=%d", info->commit_interval);
+               seq_printf(seq, ",commit=%u", info->commit_interval);
 #ifdef CONFIG_BTRFS_DEBUG
        if (btrfs_test_opt(info, FRAGMENT_DATA))
                seq_puts(seq, ",fragment=data");