From patchwork Wed Dec 10 15:06:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 5469681 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1985FBEEA8 for ; Wed, 10 Dec 2014 15:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BF8520121 for ; Wed, 10 Dec 2014 15:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4ACB4200E1 for ; Wed, 10 Dec 2014 15:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757858AbaLJPG5 (ORCPT ); Wed, 10 Dec 2014 10:06:57 -0500 Received: from cantor2.suse.de ([195.135.220.15]:43567 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757700AbaLJPG4 (ORCPT ); Wed, 10 Dec 2014 10:06:56 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F3371AB09 for ; Wed, 10 Dec 2014 15:06:55 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 8B993DA82F; Wed, 10 Dec 2014 16:06:55 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 2/3] btrfs-progs: subvol delete: add verbosity option Date: Wed, 10 Dec 2014 16:06:55 +0100 Message-Id: X-Mailer: git-send-email 2.1.3 In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an the option -v and use it for the transaction commit mode message. Signed-off-by: David Sterba --- cmds-subvolume.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 4e452f4f4eb7..b14f86e06cb4 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -66,7 +66,7 @@ static int cmd_subvol_create(int argc, char **argv) optind = 1; while (1) { - int c = getopt(argc, argv, "c:i:"); + int c = getopt(argc, argv, "c:i:v"); if (c < 0) break; @@ -217,6 +217,7 @@ static int cmd_subvol_delete(int argc, char **argv) char *dupvname = NULL; char *path; DIR *dirstream = NULL; + int verbose = 0; int sync_mode = 0; struct option long_options[] = { {"commit-after", no_argument, NULL, 'c'}, /* sync mode 1 */ @@ -239,6 +240,9 @@ static int cmd_subvol_delete(int argc, char **argv) case 'C': sync_mode = 2; break; + case 'v': + verbose++; + break; default: usage(cmd_subvol_delete_usage); } @@ -247,9 +251,11 @@ static int cmd_subvol_delete(int argc, char **argv) if (check_argc_min(argc - optind, 1)) usage(cmd_subvol_delete_usage); - printf("Transaction commit: %s\n", - !sync_mode ? "none (default)" : - sync_mode == 1 ? "at the end" : "after each"); + if (verbose > 0) { + printf("Transaction commit: %s\n", + !sync_mode ? "none (default)" : + sync_mode == 1 ? "at the end" : "after each"); + } cnt = optind;