From patchwork Thu Mar 1 19:14:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10252249 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 7A46B6037D for ; Thu, 1 Mar 2018 19:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A3D227E01 for ; Thu, 1 Mar 2018 19:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DBBE28535; Thu, 1 Mar 2018 19:14:45 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6CA627E01 for ; Thu, 1 Mar 2018 19:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161243AbeCATOn (ORCPT ); Thu, 1 Mar 2018 14:14:43 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:45128 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161241AbeCATOg (ORCPT ); Thu, 1 Mar 2018 14:14:36 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w21JCZax082152; Thu, 1 Mar 2018 19:14:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=bO55pECUWlrapV0+MIHU6hlw4T3voHylf1plhF+zjsM=; b=ozQvjY9hS6K71lvHe7NSQ+rKcMpRZm6Y9OGx4fX2xQ1l3rneYj0ED9lcbmWvmaKD/QCh GEaU7+BpUz5iZaEkDQGIA80En4C3jITbt/8XdVa3/1XwK3UtJkfFvomhPgJdGkHYwZMg gKD6B9Sk9Jx0a7WzsiXY+b0v7SGg3yGP82+bWM8sfjNAszYvcfl+BMrZwvNhW4ANvqKw 1K5x1N80RPStXxD3Adn0yAFP9KzUXb3uyOR2FuaojOA5etZdm6ld+IVIHmxX77lar5zf YyMuP74CA2fqeJGSWMkdZQMXNJSLvYhuaSCCV8V28H7cXVO4Iqlr5aUI5F4w7C8pW7bZ yQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2gep97gcf3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Mar 2018 19:14:34 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w21JEXwI008066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Mar 2018 19:14:33 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w21JEXtG017660; Thu, 1 Mar 2018 19:14:33 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 11:14:32 -0800 Subject: [PATCH 14/16] xfs_info: move to xfs_spaceman From: "Darrick J. Wong" To: sandeen@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, djwong@kernel.org Date: Thu, 01 Mar 2018 11:14:31 -0800 Message-ID: <151993167183.22223.13501751102361596724.stgit@magnolia> In-Reply-To: <151993157539.22223.6269629008244777191.stgit@magnolia> References: <151993157539.22223.6269629008244777191.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8819 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=998 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803010237 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Move xfs_info to be under spaceman so that we can remove growfs -N. Signed-off-by: Darrick J. Wong --- growfs/Makefile | 2 -- growfs/xfs_info.sh | 32 -------------------------------- spaceman/Makefile | 2 ++ spaceman/init.c | 5 ++++- spaceman/xfs_info.sh | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 35 deletions(-) delete mode 100755 growfs/xfs_info.sh create mode 100755 spaceman/xfs_info.sh -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/growfs/Makefile b/growfs/Makefile index f0190e4..adcd84b 100644 --- a/growfs/Makefile +++ b/growfs/Makefile @@ -20,7 +20,6 @@ endif LTDEPENDENCIES = $(LIBXFS) $(LIBXCMD) $(LIBFROG) LLDFLAGS = -static-libtool-libs -LSRCFILES = xfs_info.sh default: depend $(LTCOMMAND) @@ -29,7 +28,6 @@ include $(BUILDRULES) install: default $(INSTALL) -m 755 -d $(PKG_SBIN_DIR) $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR) - $(INSTALL) -m 755 xfs_info.sh $(PKG_SBIN_DIR)/xfs_info install-dev: -include .dep diff --git a/growfs/xfs_info.sh b/growfs/xfs_info.sh deleted file mode 100755 index b85f120..0000000 --- a/growfs/xfs_info.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -f -# -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. -# - -OPTS="" -USAGE="Usage: xfs_info [-V] [-t mtab] mountpoint" - -while getopts "t:V" c -do - case $c in - t) OPTS="-t $OPTARG" ;; - V) xfs_growfs -p xfs_info -V - status=$? - exit $status - ;; - *) echo $USAGE 1>&2 - exit 2 - ;; - esac -done -set -- extra "$@" -shift $OPTIND -case $# in - 1) xfs_growfs -p xfs_info -n $OPTS "$1" - status=$? - ;; - *) echo $USAGE 1>&2 - exit 2 - ;; -esac -exit $status diff --git a/spaceman/Makefile b/spaceman/Makefile index c1d903b..0d5ae2d 100644 --- a/spaceman/Makefile +++ b/spaceman/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/include/builddefs LTCOMMAND = xfs_spaceman HFILES = init.h space.h CFILES = info.c init.c file.c prealloc.c trim.c +LSRCFILES = xfs_info.sh LLDLIBS = $(LIBXCMD) $(LIBFROG) LTDEPENDENCIES = $(LIBXCMD) $(LIBFROG) @@ -35,6 +36,7 @@ include $(BUILDRULES) install: default $(INSTALL) -m 755 -d $(PKG_SBIN_DIR) $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR) + $(INSTALL) -m 755 xfs_info.sh $(PKG_SBIN_DIR)/xfs_info install-dev: -include .dep diff --git a/spaceman/init.c b/spaceman/init.c index 895504f..91c773f 100644 --- a/spaceman/init.c +++ b/spaceman/init.c @@ -81,11 +81,14 @@ init( textdomain(PACKAGE); fs_table_initialise(0, NULL, 0, NULL); - while ((c = getopt(argc, argv, "c:V")) != EOF) { + while ((c = getopt(argc, argv, "c:p:V")) != EOF) { switch (c) { case 'c': add_user_command(optarg); break; + case 'p': + progname = optarg; + break; case 'V': printf(_("%s version %s\n"), progname, VERSION); exit(0); diff --git a/spaceman/xfs_info.sh b/spaceman/xfs_info.sh new file mode 100755 index 0000000..5df0a26 --- /dev/null +++ b/spaceman/xfs_info.sh @@ -0,0 +1,32 @@ +#!/bin/sh -f +# +# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. +# + +OPTS="" +USAGE="Usage: xfs_info [-V] [-t mtab] mountpoint" + +while getopts "t:V" c +do + case $c in + t) OPTS="-t $OPTARG" ;; + V) xfs_spaceman -p xfs_info -V + status=$? + exit $status + ;; + *) echo $USAGE 1>&2 + exit 2 + ;; + esac +done +set -- extra "$@" +shift $OPTIND +case $# in + 1) xfs_spaceman -p xfs_info -c "info" $OPTS "$1" + status=$? + ;; + *) echo $USAGE 1>&2 + exit 2 + ;; +esac +exit $status