[RFC PATCH 05/14] btrfs-progs: migrate balance status to global verbose

Anand Jain
2019-10-21T10:01:44Z

Make sure top level verbose option can enable the blalance status
subcommand's verbose option.

Suggested-by: David Sterba <dsterba@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
cmds/balance.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/cmds/balance.c b/cmds/balance.c
index 7e84efd6a80d..d4916c5fb34e 100644
--- a/cmds/balance.c
+++ b/cmds/balance.c
@@ -822,7 +822,7 @@ static const char * const cmd_balance_status_usage[] = {
"btrfs balance status [-v] <path>",
"Show status of running or paused balance",
"",
- "-v be verbose",
+ HELPINFO_INSERT_VERBOSE_SHORT,
NULL
};

@@ -839,7 +839,6 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
const char *path;
DIR *dirstream = NULL;
int fd;
- int verbose = 0;
int ret;

optind = 0;
@@ -856,7 +855,7 @@ static int cmd_balance_status(const struct cmd_struct *cmd,

switch (opt) {
case 'v':
- verbose = 1;
+ global_verbose = true;
break;
default:
usage_unknown_option(cmd, argv);
@@ -902,7 +901,7 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
(unsigned long long)args.stat.considered,
100 * (1 - (float)args.stat.completed/args.stat.expected));

- if (verbose)
+ if (global_verbose)
dump_ioctl_balance_args(&args);

ret = 1;
--
1.8.3.1