From patchwork Sun Jun 10 05:07:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 10456559 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 5AE9B601F7 for ; Sun, 10 Jun 2018 05:10:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BCCF20700 for ; Sun, 10 Jun 2018 05:10:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 407FD25D99; Sun, 10 Jun 2018 05:10:25 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 CD64F20700 for ; Sun, 10 Jun 2018 05:10:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932188AbeFJFKW (ORCPT ); Sun, 10 Jun 2018 01:10:22 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56042 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753729AbeFJFKT (ORCPT ); Sun, 10 Jun 2018 01:10:19 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5A58dBg072601 for ; Sun, 10 Jun 2018 05:10:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=cC+QHQJhEHj00zKxev0ziDttUXAcapSNfd6WbDUBCrI=; b=BPiTsJDhAaKQa3FCqVAvYgt1+vdzUytFajGhcGHK7RxMqplNk2jVHg39GP9hsIT8Nz21 Vfy7Pd65AQFBCM4JKlOW9LJDOFZkcOTsVsAzCSvScAd4uNrcWFCUBhtl4tmgoQwCmWTU QeUTOQ/8gc08KWmE5O/kQEjU548Sy+FqbCeuO8PeyCvycjlMwhZukvwlsikmOiG/va7V vOJm6QxeC/lERnppqFvsQJw98sQyZq615y+rxoEZ/NsskPfe42ZpzFzSriOeA0U58zO5 t0VN+NThR5eyVrfHBY7h8utmROLNv3Hxr7LEeXejUxivcaH1PeeOaLhgsk6/NIEc1D4g mw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2jg6b19w8a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 10 Jun 2018 05:10:18 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5A5AI40024615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 10 Jun 2018 05:10:18 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5A5AHE3030475 for ; Sun, 10 Jun 2018 05:10:17 GMT Received: from localhost.localdomain (/72.210.40.165) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 09 Jun 2018 22:10:17 -0700 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v2 20/27] xfsprogs: Add parent pointer flag to cmd Date: Sat, 9 Jun 2018 22:07:45 -0700 Message-Id: <1528607272-11122-21-git-send-email-allison.henderson@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528607272-11122-1-git-send-email-allison.henderson@oracle.com> References: <1528607272-11122-1-git-send-email-allison.henderson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8919 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=825 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806100059 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 mkfs: enable formatting with parent pointers Enable parent pointer support in mkfs via the '-n parent' parameter. Signed-off-by: Allison Henderson --- mkfs/xfs_mkfs.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 78d0ce5..b9a8b00 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -104,6 +104,7 @@ enum { N_SIZE = 0, N_VERSION, N_FTYPE, + N_PARENT, N_MAX_OPTS, }; @@ -550,6 +551,7 @@ struct opt_params nopts = { [N_SIZE] = "size", [N_VERSION] = "version", [N_FTYPE] = "ftype", + [N_PARENT] = "parent", }, .subopt_params = { { .index = N_SIZE, @@ -572,6 +574,12 @@ struct opt_params nopts = { .maxval = 1, .defaultval = 1, }, + { .index = N_PARENT, + .conflicts = { { NULL, LAST_CONFLICT } }, + .minval = 0, + .maxval = 1, + .defaultval = 1, + }, }, }; @@ -876,7 +884,7 @@ usage( void ) /* log subvol */ [-l agnum=n,internal,size=num,logdev=xxx,version=n\n\ sunit=value|su=num,sectsize=num,lazy-count=0|1]\n\ /* label */ [-L label (maximum 12 characters)]\n\ -/* naming */ [-n size=num,version=2|ci,ftype=0|1]\n\ +/* naming */ [-n size=num,version=2|ci,ftype=0|1,parent=0|1]\n\ /* no-op info only */ [-N]\n\ /* prototype file */ [-p fname]\n\ /* quiet */ [-q]\n\ @@ -1615,6 +1623,9 @@ naming_opts_parser( case N_FTYPE: cli->sb_feat.dirftype = getnum(value, opts, subopt); break; + case N_PARENT: + cli->sb_feat.parent_pointers = getnum(value, &nopts, N_PARENT); + break; default: return -EINVAL; } @@ -2887,6 +2898,8 @@ sb_set_features( sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_RMAPBT; if (fp->reflink) sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_REFLINK; + if (fp->parent_pointers) + sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_PARENT; /* * Sparse inode chunk support has two main inode alignment requirements.