From patchwork Thu Sep 15 21:53:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9334765 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 B389060839 for ; Thu, 15 Sep 2016 21:54:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3B2B29BB9 for ; Thu, 15 Sep 2016 21:54:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 984F229C45; Thu, 15 Sep 2016 21:54:03 +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 F350A29BB9 for ; Thu, 15 Sep 2016 21:54:02 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id B516D7CA1; Thu, 15 Sep 2016 16:54:00 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id 2C7F77CA0 for ; Thu, 15 Sep 2016 16:53:58 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay3.corp.sgi.com (Postfix) with ESMTP id 7A4D2AC001 for ; Thu, 15 Sep 2016 14:53:54 -0700 (PDT) X-ASG-Debug-ID: 1473976432-0bf57b0f53320740001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id rKWc64Jh1aIJECDB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 15 Sep 2016 14:53:53 -0700 (PDT) X-Barracuda-Envelope-From: sandeen@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-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 A014465F5D for ; Thu, 15 Sep 2016 21:53:52 +0000 (UTC) Received: from Liberator.example.com (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8FLrpQC014513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 15 Sep 2016 17:53:52 -0400 To: xfs-oss From: Eric Sandeen Subject: [PATCH] xfs_quota: Enable 3 more foreign commands Message-ID: <5fe315ee-1198-ca43-16a0-13562ced179e@redhat.com> X-ASG-Orig-Subj: [PATCH] xfs_quota: Enable 3 more foreign commands Date: Thu, 15 Sep 2016 16:53:51 -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 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 15 Sep 2016 21:53:52 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1473976433 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3004 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 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: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP Enable restore, limit, and timer. Unsupported commands remain, for lack of kernel support, generally: warn, quot,, enable, disable, and remove. xfs_quota> report User quota on /mnt/test2/git/xfsprogs/mnt (/dev/loop0) Blocks User ID Used Soft Hard Warn/Grace ---------- -------------------------------------------------- root 13 0 0 00 [--------] xfs_quota> restore -f quotadump xfs_quota> report User quota on /mnt/test2/git/xfsprogs/mnt (/dev/loop0) Blocks User ID Used Soft Hard Warn/Grace ---------- -------------------------------------------------- root 13 0 0 00 [--------] testuser 0 16384 32768 00 [--------] fsgqa 0 102400 112640 00 [--------] xfs_quota> limit bsoft=200m fsgqa xfs_quota> report User quota on /mnt/test2/git/xfsprogs/mnt (/dev/loop0) Blocks User ID Used Soft Hard Warn/Grace ---------- -------------------------------------------------- root 13 0 0 00 [--------] testuser 0 16384 32768 00 [--------] fsgqa 0 204800 112640 00 [--------] xfs_quota> state -u User quota state on /mnt/test2/git/xfsprogs/mnt (/dev/loop0) Accounting: ON Enforcement: ON Inode: #12 (16 blocks, 1 extents) Blocks grace time: [7 days] Inodes grace time: [7 days] xfs_quota> timer -b 3days xfs_quota> state -u User quota state on /mnt/test2/git/xfsprogs/mnt (/dev/loop0) Accounting: ON Enforcement: ON Inode: #12 (16 blocks, 1 extents) Blocks grace time: [3 days] Inodes grace time: [7 days] Realtime Blocks grace time: [--------] Signed-off-by: Eric Sandeen Reviewed-by: Bill O'Donnell diff --git a/quota/edit.c b/quota/edit.c index e5ddc8c..36b327a 100644 --- a/quota/edit.c +++ b/quota/edit.c @@ -709,6 +709,7 @@ edit_init(void) _("[-g|-p|-u] bsoft|bhard|isoft|ihard|rtbsoft|rtbhard=N -d|id|name"); limit_cmd.oneline = _("modify quota limits"); limit_cmd.help = limit_help; + limit_cmd.flags = CMD_FLAG_FOREIGN_OK; restore_cmd.name = "restore"; restore_cmd.cfunc = restore_f; @@ -716,6 +717,7 @@ edit_init(void) restore_cmd.argmax = -1; restore_cmd.args = _("[-g|-p|-u] [-f file]"); restore_cmd.oneline = _("restore quota limits from a backup file"); + restore_cmd.flags = CMD_FLAG_FOREIGN_OK; timer_cmd.name = "timer"; timer_cmd.cfunc = timer_f; @@ -724,6 +726,7 @@ edit_init(void) timer_cmd.args = _("[-bir] [-g|-p|-u] value"); timer_cmd.oneline = _("set quota enforcement timeouts"); timer_cmd.help = timer_help; + timer_cmd.flags = CMD_FLAG_FOREIGN_OK; warn_cmd.name = "warn"; warn_cmd.cfunc = warn_f;