From ec2e60bf5570198229b013f79535d9a918a9a383 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Fri, 12 Jun 2020 01:41:18 +0800 Subject: [PATCH] btrfs-progs: subvolume delete: add global quiet option Enable the quiet option to the subvolume delete command. Does the job quietly. For example: $ btrfs --quiet subvolume delete Signed-off-by: Anand Jain Signed-off-by: David Sterba --- cmds/subvolume.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmds/subvolume.c b/cmds/subvolume.c index 459661a9..582ab378 100644 --- a/cmds/subvolume.c +++ b/cmds/subvolume.c @@ -241,6 +241,7 @@ static const char * const cmd_subvol_delete_usage[] = { "-v|--verbose verbose output of operations", HELPINFO_INSERT_GLOBALS, HELPINFO_INSERT_VERBOSE, + HELPINFO_INSERT_QUIET, NULL }; @@ -359,14 +360,15 @@ again: goto out; } - printf("Delete subvolume (%s): ", - commit_mode == COMMIT_EACH || (commit_mode == COMMIT_AFTER && cnt + 1 == argc) - ? "commit" : "no-commit"); + pr_verbose(MUST_LOG, "Delete subvolume (%s): ", + commit_mode == COMMIT_EACH || + (commit_mode == COMMIT_AFTER && cnt + 1 == argc) ? + "commit" : "no-commit"); if (subvolid == 0) - printf("'%s/%s'\n", dname, vname); + pr_verbose(MUST_LOG, "'%s/%s'\n", dname, vname); else - printf("'%s'\n", full_subvolpath); + pr_verbose(MUST_LOG, "'%s'\n", full_subvolpath); if (subvolid == 0) err = btrfs_util_delete_subvolume_fd(fd, vname, 0);