btrfs-progs: tune: use long option to enable simple quota

The initial patch used -q for enabling simple quota but this is not
right, -q is reserved for --quiet and we want the long options first.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-10-13 22:44:41 +02:00
parent 83ae2d58c9
commit d71ece203a
1 changed files with 11 additions and 6 deletions

View File

@ -201,7 +201,10 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST,
GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE,
GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE,
GETOPT_VAL_ENABLE_FREE_SPACE_TREE };
GETOPT_VAL_ENABLE_FREE_SPACE_TREE,
GETOPT_VAL_ENABLE_SIMPLE_QUOTA,
};
static const struct option long_options[] = {
{ "help", no_argument, NULL, GETOPT_VAL_HELP},
{ "convert-to-block-group-tree", no_argument, NULL,
@ -210,12 +213,14 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE},
{ "convert-to-free-space-tree", no_argument, NULL,
GETOPT_VAL_ENABLE_FREE_SPACE_TREE},
{ "enable-simple-quota", no_argument, NULL,
GETOPT_VAL_ENABLE_SIMPLE_QUOTA },
#if EXPERIMENTAL
{ "csum", required_argument, NULL, GETOPT_VAL_CSUM },
#endif
{ NULL, 0, NULL, 0 }
};
int c = getopt_long(argc, argv, "S:rxqfuU:nmM:", long_options, NULL);
int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL);
if (c < 0)
break;
@ -233,10 +238,6 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
super_flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA;
btrfstune_cmd_groups[LEGACY] = true;
break;
case 'q':
quota = 1;
btrfstune_cmd_groups[QGROUP] = true;
break;
case 'n':
super_flags |= BTRFS_FEATURE_INCOMPAT_NO_HOLES;
btrfstune_cmd_groups[LEGACY] = true;
@ -277,6 +278,10 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
to_fst = true;
btrfstune_cmd_groups[SPACE_CACHE] = true;
break;
case GETOPT_VAL_ENABLE_SIMPLE_QUOTA:
quota = 1;
btrfstune_cmd_groups[QGROUP] = true;
break;
#if EXPERIMENTAL
case GETOPT_VAL_CSUM:
btrfs_warn_experimental(