From patchwork Mon Mar 9 11:02:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 5966361 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D67759F318 for ; Mon, 9 Mar 2015 11:03:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E23342024C for ; Mon, 9 Mar 2015 11:02:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4E7920222 for ; Mon, 9 Mar 2015 11:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbbCILCw (ORCPT ); Mon, 9 Mar 2015 07:02:52 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38871 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbbCILCv (ORCPT ); Mon, 9 Mar 2015 07:02:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2F7C0AAC8; Mon, 9 Mar 2015 11:02:50 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 07E80DAAC5; Mon, 9 Mar 2015 12:02:49 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: jeromepoulin@gmail.com, David Sterba Subject: [PATCH] btrfs-progs: convert, add option to disable progress Date: Mon, 9 Mar 2015 12:02:47 +0100 Message-Id: <1425898967-5972-1-git-send-email-dsterba@suse.cz> X-Mailer: git-send-email 2.1.3 MIME-Version: 1.0 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 With progress turned on by default we should be able to disable it as well. Reported-by: Jérôme Poulin Signed-off-by: David Sterba --- Documentation/btrfs-convert.txt | 2 ++ btrfs-convert.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/btrfs-convert.txt b/Documentation/btrfs-convert.txt index 170919706e71..6a9e1de0bf6f 100644 --- a/Documentation/btrfs-convert.txt +++ b/Documentation/btrfs-convert.txt @@ -31,6 +31,8 @@ set filesystem label during conversion. use label from the converted filesystem. -p:: Show progress of conversion, on by default. +--no-progress:: +Disable detailed progress and show only the main phases of conversion. EXIT STATUS ----------- diff --git a/btrfs-convert.c b/btrfs-convert.c index 730fead4a86c..6a0668a4e572 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "ctree.h" #include "disk-io.h" @@ -2767,6 +2768,7 @@ static void print_usage(void) printf("\t-l LABEL set filesystem label\n"); printf("\t-L use label from converted fs\n"); printf("\t-p show converting progress (default)\n"); + printf("\t--no-progress show only overview, not the detailed progress\n"); } int main(int argc, char *argv[]) @@ -2783,7 +2785,14 @@ int main(int argc, char *argv[]) char *fslabel = NULL; while(1) { - int c = getopt(argc, argv, "dinrl:Lp"); + int long_index; + enum { GETOPT_VAL_NO_PROGRESS = 256 }; + static const struct option long_options[] = { + { "no-progress", no_argument, NULL, GETOPT_VAL_IEC}, + { NULL, 0, NULL, 0 } + }; + int c = getopt_long(argc, argv, "dinrl:Lp", long_options, + &long_index); if (c < 0) break; switch(c) { @@ -2815,6 +2824,9 @@ int main(int argc, char *argv[]) case 'p': progress = 1; break; + case GETOPT_VAL_NO_PROGRESS: + progress = 0; + break; default: print_usage(); return 1;