From patchwork Thu Feb 18 08:07:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 8347041 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B0349F38B for ; Thu, 18 Feb 2016 08:09:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E62520397 for ; Thu, 18 Feb 2016 08:09:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B63520386 for ; Thu, 18 Feb 2016 08:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425148AbcBRIIM (ORCPT ); Thu, 18 Feb 2016 03:08:12 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49638 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424672AbcBRIHl (ORCPT ); Thu, 18 Feb 2016 03:07:41 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1I87buw011933 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Feb 2016 08:07:37 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1I87boU023797 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 18 Feb 2016 08:07:37 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u1I87UEs010977; Thu, 18 Feb 2016 08:07:36 GMT Received: from arch2.sg.oracle.com (/10.186.101.133) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 18 Feb 2016 00:07:29 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz, clm@fb.com Subject: [PATCH RFC] btrfs-progs: make add and delete path max len consistent Date: Thu, 18 Feb 2016 16:07:17 +0800 Message-Id: <1455782837-15630-3-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455782837-15630-1-git-send-email-anand.jain@oracle.com> References: <20160217104911.GS4374@twin.jikos.cz> <1455782837-15630-1-git-send-email-anand.jain@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add device ioctl uses BTRFS_PATH_NAME_MAX however delete uses BTRFS_SUBVOL_NAME_MAX to hold device path. This patch makes them consistent. Depends on btrfs: make add and device ioctl args path max consistent Signed-off-by: Anand Jain --- cmds-device.c | 2 +- ioctl.h | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cmds-device.c b/cmds-device.c index 879ba94d7ea5..be07e34c2af8 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -160,7 +160,7 @@ static int _cmd_device_remove(int argc, char **argv, struct btrfs_ioctl_vol_args arg; int res; - struct btrfs_ioctl_vol_args_v2 argv2 = {0}; + struct btrfs_ioctl_vol_args_v3 argv2 = {0}; int is_devid = 0; if (string_is_numerical(argv[i])) { diff --git a/ioctl.h b/ioctl.h index 1560dcb4b457..8e444ca374fd 100644 --- a/ioctl.h +++ b/ioctl.h @@ -92,6 +92,23 @@ struct btrfs_ioctl_vol_args_v2 { }; }; +struct btrfs_ioctl_vol_args_v3 { + __s64 fd; + __u64 transid; + __u64 flags; + union { + struct { + __u64 size; + struct btrfs_qgroup_inherit __user *qgroup_inherit; + }; + __u64 unused[4]; + }; + union { + char name[BTRFS_PATH_NAME_MAX + 1]; + u64 devid; + }; +}; + /* * structure to report errors and progress to userspace, either as a * result of a finished scrub, a canceled scrub or a progress inquiry @@ -689,7 +706,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code) #define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ struct btrfs_ioctl_feature_flags[3]) #define BTRFS_IOC_RM_DEV_V2 _IOW(BTRFS_IOCTL_MAGIC, 58, \ - struct btrfs_ioctl_vol_args_v2) + struct btrfs_ioctl_vol_args_v3) #ifdef __cplusplus } #endif