From patchwork Fri Sep 30 20:52:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9485651 X-Mozilla-Keys: nonjunk Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sandeen.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-Spam-HP: BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.001, RP_MATCHES_RCVD=-0.1 X-Original-To: sandeen@sandeen.net Delivered-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id 3494F1431 for ; Fri, 30 Sep 2016 15:52:28 -0500 (CDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbcI3Uw7 (ORCPT ); Fri, 30 Sep 2016 16:52:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbcI3Uw7 (ORCPT ); Fri, 30 Sep 2016 16:52:59 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C26A57EA99 for ; Fri, 30 Sep 2016 20:52:08 +0000 (UTC) Received: from Liberator.example.com (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8UKq7Fv008957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Sep 2016 16:52:08 -0400 Subject: [PATCH 1/5] xfs_io: fix inode command help and argsmax To: Eric Sandeen , linux-xfs References: <9f126dc7-3b1e-a1ed-7f23-48410a76adc2@redhat.com> From: Eric Sandeen Message-ID: Date: Fri, 30 Sep 2016 15:52:08 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <9f126dc7-3b1e-a1ed-7f23-48410a76adc2@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 30 Sep 2016 20:52:08 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org The short help implied that -n and -v were exclusive, and the longer help wasn't particularly clear. Further, argsmax is wrong; "-n -v num" is 3, not 2. # xfs_io -c "inode -n -v 123" /mnt/test2 bad argument count 3 to inode, expected between 0 and 2 arguments # xfs_io -c "inode -vn 123" /mnt/test2 128:32 Fix up all of those issues. Signed-off-by: Eric Sandeen --- io/open.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/io/open.c b/io/open.c index 3eaa013..5efa739 100644 --- a/io/open.c +++ b/io/open.c @@ -757,16 +757,13 @@ inode_help(void) { printf(_( "\n" -"Query physical information about the inode" +"Query physical information about an inode" "\n" -" Default: -- Return true(1) or false(0) if any inode greater than\n" -" 32bits has been found in the filesystem\n" -"[num] -- Return inode number [num] or 0 if the inode [num] is in use\n" -" or not\n" -" -n [num] -- Return the next valid inode after [num]\n" -" -v -- verbose mode\n" -" Display the inode number and its physical size (in bits)\n" -" according to the argument used\n" +" Default: -- Return 1 if any inode number greater than 32 bits exists in\n" +" the filesystem, or 0 if none exist\n" +" num -- Return inode number [num] if in use, or 0 if not in use\n" +" -n num -- Return the next used inode after [num]\n" +" -v -- Verbose mode - display returned inode number's size in bits\n" "\n")); } @@ -956,9 +953,9 @@ open_init(void) inode_cmd.name = "inode"; inode_cmd.cfunc = inode_f; - inode_cmd.args = _("[-n | -v] [num]"); + inode_cmd.args = _("[-nv] [num]"); inode_cmd.argmin = 0; - inode_cmd.argmax = 2; + inode_cmd.argmax = 3; inode_cmd.flags = CMD_NOMAP_OK; inode_cmd.oneline = _("Query inode number usage in the filesystem");