btrfs-progs: alias btrfs device delete to btrfs device remove
[platform/upstream/btrfs-progs.git] / cmds-balance.c
index 6d8861e..9af218b 100644 (file)
 #include "utils.h"
 
 static const char * const balance_cmd_group_usage[] = {
-       "btrfs [filesystem] balance <command> [options] <path>",
-       "btrfs [filesystem] balance <path>",
+       "btrfs balance <command> [options] <path>",
+       "btrfs balance <path>",
        NULL
 };
 
-static const char balance_cmd_group_info[] =
-       "'btrfs filesystem balance' command is deprecated, please use\n"
-       "'btrfs balance start' command instead.";
-
 static int parse_one_profile(const char *profile, u64 *flags)
 {
        if (!strcmp(profile, "raid0")) {
@@ -359,7 +355,7 @@ out:
 }
 
 static const char * const cmd_balance_start_usage[] = {
-       "btrfs [filesystem] balance start [options] <path>",
+       "btrfs balance start [options] <path>",
        "Balance chunks across the devices",
        "Balance and/or convert (change allocation profile of) chunks that",
        "passed all filters in a comma-separated list of filters for a",
@@ -389,7 +385,6 @@ static int cmd_balance_start(int argc, char **argv)
 
        optind = 1;
        while (1) {
-               int longindex;
                static const struct option longopts[] = {
                        { "data", optional_argument, NULL, 'd'},
                        { "metadata", optional_argument, NULL, 'm' },
@@ -399,8 +394,7 @@ static int cmd_balance_start(int argc, char **argv)
                        { NULL, 0, NULL, 0 }
                };
 
-               int opt = getopt_long(argc, argv, "d::s::m::fv", longopts,
-                                     &longindex);
+               int opt = getopt_long(argc, argv, "d::s::m::fv", longopts, NULL);
                if (opt < 0)
                        break;
 
@@ -491,7 +485,7 @@ static int cmd_balance_start(int argc, char **argv)
 }
 
 static const char * const cmd_balance_pause_usage[] = {
-       "btrfs [filesystem] balance pause <path>",
+       "btrfs balance pause <path>",
        "Pause running balance",
        NULL
 };
@@ -532,7 +526,7 @@ static int cmd_balance_pause(int argc, char **argv)
 }
 
 static const char * const cmd_balance_cancel_usage[] = {
-       "btrfs [filesystem] balance cancel <path>",
+       "btrfs balance cancel <path>",
        "Cancel running or paused balance",
        NULL
 };
@@ -573,7 +567,7 @@ static int cmd_balance_cancel(int argc, char **argv)
 }
 
 static const char * const cmd_balance_resume_usage[] = {
-       "btrfs [filesystem] balance resume <path>",
+       "btrfs balance resume <path>",
        "Resume interrupted balance",
        NULL
 };
@@ -636,7 +630,7 @@ static int cmd_balance_resume(int argc, char **argv)
 }
 
 static const char * const cmd_balance_status_usage[] = {
-       "btrfs [filesystem] balance status [-v] <path>",
+       "btrfs balance status [-v] <path>",
        "Show status of running or paused balance",
        "",
        "-v     be verbose",
@@ -661,13 +655,13 @@ static int cmd_balance_status(int argc, char **argv)
 
        optind = 1;
        while (1) {
-               int longindex;
+               int opt;
                static const struct option longopts[] = {
                        { "verbose", no_argument, NULL, 'v' },
                        { NULL, 0, NULL, 0 }
                };
 
-               int opt = getopt_long(argc, argv, "v", longopts, &longindex);
+               opt = getopt_long(argc, argv, "v", longopts, NULL);
                if (opt < 0)
                        break;
 
@@ -729,6 +723,9 @@ static int cmd_balance_status(int argc, char **argv)
        return 1;
 }
 
+static const char balance_cmd_group_info[] =
+"balance data accross devices, or change block groups using filters";
+
 const struct cmd_group balance_cmd_group = {
        balance_cmd_group_usage, balance_cmd_group_info, {
                { "start", cmd_balance_start, cmd_balance_start_usage, NULL, 0 },