From patchwork Thu Sep 15 15:29:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill O'Donnell X-Patchwork-Id: 9334063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84EE760839 for ; Thu, 15 Sep 2016 15:30:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7806829957 for ; Thu, 15 Sep 2016 15:30:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BF0029991; Thu, 15 Sep 2016 15:30:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D47829957 for ; Thu, 15 Sep 2016 15:30:09 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 19CE97CA6; Thu, 15 Sep 2016 10:30:01 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 471057CA0 for ; Thu, 15 Sep 2016 10:29:59 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id 18B198F8039 for ; Thu, 15 Sep 2016 08:29:59 -0700 (PDT) X-ASG-Debug-ID: 1473953397-0bf57c1b0a7ed310001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id X3YICk1AjYkqu55w (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 15 Sep 2016 08:29:58 -0700 (PDT) X-Barracuda-Envelope-From: billodo@redhat.com X-Barracuda-Effective-Source-IP: mx1.redhat.com[209.132.183.28] X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 84C0F7AE85; Thu, 15 Sep 2016 15:29:57 +0000 (UTC) Received: from localhost.localdomain.com (vpn-49-118.rdu2.redhat.com [10.10.49.118]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8FFTt1n027483; Thu, 15 Sep 2016 11:29:56 -0400 From: "Bill O'Donnell" To: linux-xfs@vger.kernel.org Subject: [PATCH v2 2/3] xfs_quota: print and path output formatting: maintain reverse compatibility Date: Thu, 15 Sep 2016 10:29:45 -0500 X-ASG-Orig-Subj: [PATCH v2 2/3] xfs_quota: print and path output formatting: maintain reverse compatibility Message-Id: <1473953386-10242-3-git-send-email-billodo@redhat.com> In-Reply-To: <1473953386-10242-1-git-send-email-billodo@redhat.com> References: <1473866381-28975-1-git-send-email-billodo@redhat.com> <1473953386-10242-1-git-send-email-billodo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 15 Sep 2016 15:29:57 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1473953398 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.15:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1482 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Cc: xfs@oss.sgi.com X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP This patch adjusts the formatting of the xfs_quota print and path outputs, in order to maintain reverse compatability: when -f flag isn't used, need to keep the output same as in previous version. Signed-off-by: Bill O'Donnell Reviewed-by: Eric Sandeen --- quota/path.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/quota/path.c b/quota/path.c index 01ccab4..57d14f0 100644 --- a/quota/path.c +++ b/quota/path.c @@ -36,13 +36,14 @@ printpath( int c; if (index == 0) { - printf(_("%sFilesystem Pathname\n"), - number ? _(" ") : ""); + printf(_("%s%sFilesystem Pathname\n"), + number ? _(" ") : "", + foreign_allowed ? _(" ") : ""); } - if (number) { + if (number) printf(_("%c%03d%c "), braces? '[':' ', index, braces? ']':' '); - } - printf("%s ", (path->fs_flags & FS_FOREIGN) ? "(F)" : " "); + if (foreign_allowed) + printf("%s", (path->fs_flags & FS_FOREIGN) ? "(F) " : " "); printf(_("%-19s %s"), path->fs_dir, path->fs_name); if (path->fs_flags & FS_PROJECT_PATH) { prj = getprprid(path->fs_prid); @@ -51,7 +52,7 @@ printpath( printf(_(", %s"), prj->pr_name); printf(")"); } else if (xfsquotactl(XFS_GETQSTAT, path->fs_name, 0, 0, - (void *)&qstat) == 0 && qstat.qs_flags) { + (void *)&qstat) == 0 && qstat.qs_flags) { c = 0; printf(" ("); if (qstat.qs_flags & XFS_QUOTA_UDQ_ENFD)