mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-24 12:07:54 +00:00
btrfs-progs: balance status: add global verbose option
Propagate global --verbose option down to the btrfs balance status subcommand. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2540a6d12d
commit
25c8817d87
@ -830,6 +830,8 @@ static const char * const cmd_balance_status_usage[] = {
|
|||||||
"Show status of running or paused balance",
|
"Show status of running or paused balance",
|
||||||
"",
|
"",
|
||||||
"-v|--verbose be verbose",
|
"-v|--verbose be verbose",
|
||||||
|
HELPINFO_INSERT_GLOBALS,
|
||||||
|
HELPINFO_INSERT_VERBOSE,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -846,7 +848,6 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
|
|||||||
const char *path;
|
const char *path;
|
||||||
DIR *dirstream = NULL;
|
DIR *dirstream = NULL;
|
||||||
int fd;
|
int fd;
|
||||||
int verbose = 0;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
optind = 0;
|
optind = 0;
|
||||||
@ -863,7 +864,7 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
|
|||||||
|
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose = 1;
|
bconf_be_verbose();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage_unknown_option(cmd, argv);
|
usage_unknown_option(cmd, argv);
|
||||||
@ -909,7 +910,7 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
|
|||||||
(unsigned long long)args.stat.considered,
|
(unsigned long long)args.stat.considered,
|
||||||
100 * (1 - (float)args.stat.completed/args.stat.expected));
|
100 * (1 - (float)args.stat.completed/args.stat.expected));
|
||||||
|
|
||||||
if (verbose)
|
if (bconf.verbose > BTRFS_BCONF_QUIET)
|
||||||
dump_ioctl_balance_args(&args);
|
dump_ioctl_balance_args(&args);
|
||||||
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user