diff mbox series

[4/8] btrfs-progs: balance start: add quiet option

Message ID 20200608063851.8874-5-anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: add quiet option | expand

Commit Message

Anand Jain June 8, 2020, 6:38 a.m. UTC
Enable the quiet option to the btrfs(8) balance start command.
Does the job quietly. For example:
	btrfs -q balance start --full-balance <path>

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds/balance.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/cmds/balance.c b/cmds/balance.c
index b35d90dc362a..154f54c3e3a6 100644
--- a/cmds/balance.c
+++ b/cmds/balance.c
@@ -470,9 +470,10 @@  static int do_balance(const char *path, struct btrfs_ioctl_balance_args *args,
 	} else if (ret > 0) {
 		error("balance: %s", btrfs_err_str(ret));
 	} else {
-		printf("Done, had to relocate %llu out of %llu chunks\n",
-		       (unsigned long long)args->stat.completed,
-		       (unsigned long long)args->stat.considered);
+		pr_verbose(-1,
+			   "Done, had to relocate %llu out of %llu chunks\n",
+			   (unsigned long long)args->stat.completed,
+			   (unsigned long long)args->stat.considered);
 	}
 
 out:
@@ -501,6 +502,7 @@  static const char * const cmd_balance_start_usage[] = {
 	"               run the balance as a background process",
 	HELPINFO_INSERT_GLOBALS,
 	HELPINFO_INSERT_VERBOSE,
+	HELPINFO_INSERT_QUIET,
 	NULL
 };