@@ -99,7 +99,8 @@ act on metadata chunks, see `FILTERS` section for details about 'filters'
-s[<filters>]::::
act on system chunks (requires '-f'), see `FILTERS` section for details about 'filters'.
-v::::
-be verbose and print balance filter arguments
+be verbose and print balance filter arguments. This option is merged to the
+global verbose option.
-f::::
force a reduction of metadata integrity, eg. when going from 'raid1' to 'single'
--background|--bg::::
@@ -494,11 +494,14 @@ static const char * const cmd_balance_start_usage[] = {
"-d[filters] act on data chunks",
"-m[filters] act on metadata chunks",
"-s[filters] act on system chunks (only under -f)",
- "-v|--verbose be verbose",
+ "-v|--verbose be verbose. This option is merged to the global",
+ " verbose option.",
"-f force a reduction of metadata integrity",
"--full-balance do not print warning and do not delay start",
"--background|--bg",
" run the balance as a background process",
+ HELPINFO_INSERT_GLOBALS,
+ HELPINFO_INSERT_VERBOSE,
NULL
};
@@ -509,7 +512,6 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
struct btrfs_balance_args *ptrs[] = { &args.data, &args.sys,
&args.meta, NULL };
int force = 0;
- int verbose = 0;
int background = 0;
unsigned start_flags = 0;
int i;
@@ -564,7 +566,7 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
force = 1;
break;
case 'v':
- verbose = 1;
+ bconf_be_verbose();
break;
case GETOPT_VAL_FULL_BALANCE:
start_flags |= BALANCE_START_NOWARN;
@@ -640,7 +642,7 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
if (force)
args.flags |= BTRFS_BALANCE_FORCE;
- if (verbose)
+ if (bconf.verbose > BTRFS_BCONF_QUIET)
dump_ioctl_balance_args(&args);
if (background) {
switch (fork()) {
Transpire global --verbose option down to the btrfs balance start sub-command. Suggested-by: David Sterba <dsterba@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com> --- v3: update help and documentation v2: Use new helper functions and defines HELPINFO_INSERT_GLOBALS, BTRFS_BCONF_UNSET, BTRFS_BCONF_QUIET bconf_be_verbose(), bconf_be_quiet() No need to init bconf.verbose in the sub command. Documentation/btrfs-balance.asciidoc | 3 ++- cmds/balance.c | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-)