public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [RFC PATCH 04/14] btrfs-progs: migrate btrfs balance start to global verbose
Date: Mon, 21 Oct 2019 18:01:12 +0800	[thread overview]
Message-ID: <1571652082-25982-5-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1571652082-25982-1-git-send-email-anand.jain@oracle.com>

Make sure the sub command balance start calls verbose when the global
verbose is set and vise versa.

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

diff --git a/cmds/balance.c b/cmds/balance.c
index 32830002f3a0..7e84efd6a80d 100644
--- a/cmds/balance.c
+++ b/cmds/balance.c
@@ -34,6 +34,8 @@
 #include "common/utils.h"
 #include "common/help.h"
 
+extern bool global_verbose;
+
 static const char * const balance_cmd_group_usage[] = {
 	"btrfs balance <command> [options] <path>",
 	"btrfs balance <path>",
@@ -487,14 +489,13 @@ static const char * const cmd_balance_start_usage[] = {
 	"long operation and the user is warned before this start, with",
 	"a delay to stop it.",
 	"",
-	"-d[filters]    act on data chunks",
-	"-m[filters]    act on metadata chunks",
-	"-s[filters]    act on system chunks (only under -f)",
-	"-v             be verbose",
-	"-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",
+	"-d[filters]        act on data chunks",
+	"-m[filters]        act on metadata chunks",
+	"-s[filters]        act on system chunks (only under -f)",
+	HELPINFO_INSERT_VERBOSE_SHORT,
+	"-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",
 	NULL
 };
 
@@ -505,7 +506,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;
@@ -560,7 +560,7 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
 			force = 1;
 			break;
 		case 'v':
-			verbose = 1;
+			global_verbose = true;
 			break;
 		case GETOPT_VAL_FULL_BALANCE:
 			start_flags |= BALANCE_START_NOWARN;
@@ -636,7 +636,7 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
 
 	if (force)
 		args.flags |= BTRFS_BALANCE_FORCE;
-	if (verbose)
+	if (global_verbose)
 		dump_ioctl_balance_args(&args);
 	if (background) {
 		switch (fork()) {
-- 
1.8.3.1


  parent reply	other threads:[~2019-10-21 10:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 10:01 [RFC PATCH 00/14] btrfs-progs: global-verbose option Anand Jain
2019-10-21 10:01 ` [RFC PATCH 01/14] btrfs-progs: add global verbose helper functions Anand Jain
2019-10-21 10:01 ` [RFC PATCH 02/14] btrfs-progs: migrate subvolume delete to global verbose Anand Jain
2019-10-21 10:01 ` [RFC PATCH 03/14] btrfs-progs: migrate filesystem defragment " Anand Jain
2019-10-21 10:01 ` Anand Jain [this message]
2019-10-21 10:01 ` [RFC PATCH 05/14] btrfs-progs: migrate balance status " Anand Jain
2019-10-21 10:01 ` [RFC PATCH 06/14] btrfs-progs: fix help, show long option in balance start and status Anand Jain
2019-10-21 10:01 ` [RFC PATCH 07/14] btrfs-progs: migrate rescue chunk-recover to global verbose Anand Jain
2019-10-21 10:01 ` [RFC PATCH 08/14] btrfs-progs: migrate rescue super-recover " Anand Jain
2019-10-21 10:01 ` [RFC PATCH 09/14] btrfs-progs: restore: delete unreachable code Anand Jain
2019-10-21 10:01 ` [RFC PATCH 10/14] btrfs-progs: migrate restore to global verbose Anand Jain
2019-10-21 10:01 ` [RFC PATCH 11/14] btrfs-progs: migrate inspect-internal inode-resolve " Anand Jain
2019-10-21 10:01 ` [RFC PATCH 12/14] btrfs-progs: migrate inspect-internal logical-resolve " Anand Jain
2019-10-21 10:01 ` [RFC PATCH 13/14] btrfs-progs: refactor btrfs_scan_devices() to accept verbose argument Anand Jain
2019-10-21 10:01 ` [RFC PATCH 14/14] btrfs-progs: enable verbose for btrfs device scan Anand Jain
2019-10-21 16:12 ` [RFC PATCH 00/14] btrfs-progs: global-verbose option David Sterba
2019-10-22  1:54   ` Anand Jain
2019-10-22 11:45     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1571652082-25982-5-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox