From patchwork Tue Dec 19 10:53:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10122983 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 DD45C602CB for ; Tue, 19 Dec 2017 10:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3DB32879A for ; Tue, 19 Dec 2017 10:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C868A291B0; Tue, 19 Dec 2017 10:53:47 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 27BEA2879A for ; Tue, 19 Dec 2017 10:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762158AbdLSKxp (ORCPT ); Tue, 19 Dec 2017 05:53:45 -0500 Received: from victor.provo.novell.com ([137.65.250.26]:41643 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762154AbdLSKxo (ORCPT ); Tue, 19 Dec 2017 05:53:44 -0500 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Tue, 19 Dec 2017 03:53:34 -0700 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH] btrfs-progs: qgroup: Remove support for specifying inherit type Date: Tue, 19 Dec 2017 18:53:31 +0800 Message-Id: <20171219105331.9636-1-wqu@suse.com> X-Mailer: git-send-email 2.15.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since kernel is deprecating the support for specifying inherit type, remove the support in btrfs-progs too. Thankfully, the options for qgroup inheritance is hidden and not documented, so user shouldn't be affected at all. Signed-off-by: Qu Wenruo --- cmds-subvolume.c | 21 --------------------- qgroup.c | 42 ------------------------------------------ qgroup.h | 3 --- 3 files changed, 66 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index dc626a6495e5..e0839da7d8f8 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -134,13 +134,6 @@ static int cmd_subvol_create(int argc, char **argv) break; switch (c) { - case 'c': - res = qgroup_inherit_add_copy(&inherit, optarg, 0); - if (res) { - retval = res; - goto out; - } - break; case 'i': res = qgroup_inherit_add_group(&inherit, optarg); if (res) { @@ -670,13 +663,6 @@ static int cmd_subvol_snapshot(int argc, char **argv) break; switch (c) { - case 'c': - res = qgroup_inherit_add_copy(&inherit, optarg, 0); - if (res) { - retval = res; - goto out; - } - break; case 'i': res = qgroup_inherit_add_group(&inherit, optarg); if (res) { @@ -687,13 +673,6 @@ static int cmd_subvol_snapshot(int argc, char **argv) case 'r': readonly = 1; break; - case 'x': - res = qgroup_inherit_add_copy(&inherit, optarg, 1); - if (res) { - retval = res; - goto out; - } - break; default: usage(cmd_subvol_snapshot_usage); } diff --git a/qgroup.c b/qgroup.c index 156825fd431d..e9158a260251 100644 --- a/qgroup.c +++ b/qgroup.c @@ -1310,45 +1310,3 @@ int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg) return 0; } - -int qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg, - int type) -{ - int ret; - u64 qgroup_src; - u64 qgroup_dst; - char *p; - int pos = 0; - - p = strchr(arg, ':'); - if (!p) { -bad: - error("invalid copy specification, missing separator :"); - return -EINVAL; - } - *p = 0; - qgroup_src = parse_qgroupid(arg); - qgroup_dst = parse_qgroupid(p + 1); - *p = ':'; - - if (!qgroup_src || !qgroup_dst) - goto bad; - - if (*inherit) - pos = (*inherit)->num_qgroups + - (*inherit)->num_ref_copies * 2 * type; - - ret = qgroup_inherit_realloc(inherit, 2, pos); - if (ret) - return ret; - - (*inherit)->qgroups[pos++] = qgroup_src; - (*inherit)->qgroups[pos++] = qgroup_dst; - - if (!type) - ++(*inherit)->num_ref_copies; - else - ++(*inherit)->num_excl_copies; - - return 0; -} diff --git a/qgroup.h b/qgroup.h index 875fbdf37f5f..3fc57123dc2d 100644 --- a/qgroup.h +++ b/qgroup.h @@ -92,7 +92,4 @@ int btrfs_qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set, int is_descending); int qgroup_inherit_size(struct btrfs_qgroup_inherit *p); int qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg); -int qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg, - int type); - #endif