From patchwork Wed Dec 17 20:14:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 5509171 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B486A9F1D4 for ; Wed, 17 Dec 2014 20:13:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB48D209DC for ; Wed, 17 Dec 2014 20:13:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3288208BC for ; Wed, 17 Dec 2014 20:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751225AbaLQUM7 (ORCPT ); Wed, 17 Dec 2014 15:12:59 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:38109 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbaLQUM5 (ORCPT ); Wed, 17 Dec 2014 15:12:57 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so18582wiw.16 for ; Wed, 17 Dec 2014 12:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pXqOW/KMFZSS3ppJ+JS/r1jgkAzh5vrNRQeElE4iyjo=; b=jT3ARj85R0/ymDatFy+ZPAMTEjF/5+IS0Z0TGrHemq4mJnU3s3G47s/a0HPDBrxhiN to9cXlFqnWrH5v7U5mNoEORoP42KCLKkNZuq78SfXM3sksug8wWAPY5HhZM37b/9tPF6 m77K9pmojd9JldiTyYYXmwNphGbS/9jz6IikSPYd5Cw+ONnYJfBY28U4IMjwp9dhzbdL 4HCkpcjLLsXpJijeIc6Av3sjRnUfTwBsGfb9uf9ufx27PGs/oSSRu3ppjuJ3l7J3i7KO AiqezyvXA8cGLXID8Fjdk+54i/5cdDlOwyUFBZmBy5O1tHtuah9eUZqKKyaKKGkdJeXg P8kA== X-Received: by 10.180.20.242 with SMTP id q18mr11377895wie.80.1418847176281; Wed, 17 Dec 2014 12:12:56 -0800 (PST) Received: from venice.bhome (ppp-133-85.24-151.libero.it. [151.24.85.133]) by mx.google.com with ESMTPSA id pu3sm6360357wjc.14.2014.12.17.12.12.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Dec 2014 12:12:55 -0800 (PST) From: Goffredo Baroncelli X-Google-Original-From: Goffredo Baroncelli To: linux-btrfs@vger.kernel.org Cc: Goffredo Baroncelli Subject: [PATCH 1/8] Add -v -q switches to mkfs.btrfs. Date: Wed, 17 Dec 2014 21:14:05 +0100 Message-Id: <1418847252-14184-2-git-send-email-kreijack@inwind.it> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418847252-14184-1-git-send-email-kreijack@inwind.it> References: <1418847252-14184-1-git-send-email-kreijack@inwind.it> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 -v -q switches to mkfs.btrfs, to control the verbosity of mkfs.btrfs. Signed-off-by: Goffredo Baroncelli Reviewed-by: Satoru Takeuchi --- mkfs.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mkfs.c b/mkfs.c index e10e62d..a5f19cc 100644 --- a/mkfs.c +++ b/mkfs.c @@ -288,8 +288,10 @@ static void print_usage(void) fprintf(stderr, "\t -r --rootdir the source directory\n"); fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n"); fprintf(stderr, "\t -O --features comma separated list of filesystem features\n"); + fprintf(stderr, "\t -q --quiet enable quiet mode\n"); fprintf(stderr, "\t -U --uuid specify the filesystem UUID\n"); fprintf(stderr, "\t -V --version print the mkfs.btrfs version and exit\n"); + fprintf(stderr, "\t -v --verbose enable verbose mode\n"); fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION); exit(1); } @@ -351,6 +353,8 @@ static struct option long_options[] = { { "version", 0, NULL, 'V' }, { "rootdir", 1, NULL, 'r' }, { "nodiscard", 0, NULL, 'K' }, + { "verbose", 0, NULL, 'v' }, + { "quiet", 0, NULL, 'q' }, { "features", 1, NULL, 'O' }, { "uuid", required_argument, NULL, 'U' }, { NULL, 0, NULL, 0} @@ -998,7 +1002,7 @@ out: * This ignores symlinks with unreadable targets and subdirs that can't * be read. It's a best-effort to give a rough estimate of the size of * a subdir. It doesn't guarantee that prepopulating btrfs from this - * tree won't still run out of space. + * tree won't still run out of space. * * The rounding up to 4096 is questionable. Previous code used du -B 4096. */ @@ -1266,6 +1270,8 @@ int main(int ac, char **av) int discard = 1; int ssd = 0; int force_overwrite = 0; + int verbose = 0; + int quiet = 0; char *source_dir = NULL; int source_dir_set = 0; @@ -1280,7 +1286,7 @@ int main(int ac, char **av) while(1) { int c; - c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMK", + c = getopt_long(ac, av, "A:b:fl:n:s:m:d:L:O:r:U:VMKqv", long_options, &option_index); if (c < 0) break; @@ -1355,6 +1361,12 @@ int main(int ac, char **av) case 'K': discard = 0; break; + case 'v': + verbose = 1; + break; + case 'q': + quiet = 1; + break; default: print_usage(); }