From patchwork Fri Jan 26 18:40:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10186739 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 58A30601D5 for ; Fri, 26 Jan 2018 18:41:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A2BB29ECA for ; Fri, 26 Jan 2018 18:41:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF5129EE1; Fri, 26 Jan 2018 18:41:36 +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 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 C4B9D29ECA for ; Fri, 26 Jan 2018 18:41:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506AbeAZSl0 (ORCPT ); Fri, 26 Jan 2018 13:41:26 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33610 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbeAZSlZ (ORCPT ); Fri, 26 Jan 2018 13:41:25 -0500 Received: by mail-pf0-f195.google.com with SMTP id t5so829443pfi.0 for ; Fri, 26 Jan 2018 10:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=1TQgMduKo8imh05Z5xt1WCu0K96CuemPp8aXvaHEK+M=; b=U+/1MlK4zssfPGHNk7MF/wxQJA+Dn9GWVvBpwDGhkyLDSdlpz4FiunvJqACMx+8Xm8 EgvNm6LviMCjX0+evYZUR4h809VRG8cnqgHXial5DVIO9/U5yZW5ue4EBHdoKKbASXnA x2sh9TfG3fpITwBt4KVO/PMAuquPaICVTCSZUih1AmGXmNp8/zutxC1CLzWHNCncVUu3 rUR+VrP6g35R0QQSyxoViz4FAoTnwehF7hEZQUKB4Ll4eZ0PlXobPFFw6ccitrzvDzJr XEKzesW7wb3QVWUzgD2fccWnf0Z360w/wN5OURq76+XFNOroMX5/L1I5/kHL3ed16hD7 2AXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=1TQgMduKo8imh05Z5xt1WCu0K96CuemPp8aXvaHEK+M=; b=BM5qHw9e62YzoAa2Jw5NZ1G7BUzNDe+nfH7GRnHgcDHbnudB4OZ/tO7POK7sI3yDkt A+F9rcIDaJuFyqc7m/1B3NxswlpHrL48J4DPePFzspwxjQNje6rK7TaY+mmPWFBsrxbl JIRjMC6G5B27NoYaTDl8WPjgqwJlOXIb8AiZETs4ZzpwwWh2wMyGcmqSrF+9yG7iyHhs S2kDTlo7fqF9Jd1i9xfttBGCNl7+OQSgw4mY335vacYpaLswAVae97tZQS4ZWAIIUOxD KNy3C63AzTdhVq3Pp69dXF+cOkrlfpmjuEvuTLojNLIkz60YVZCLDWVUwJGhs0FBcAqm UGJg== X-Gm-Message-State: AKwxytcvX48RYzI2YgJzfjMaskw1yM2s/0hwB8sEG0CkWSkoKNUvyLWX yBwCvTf+MraVAKweOKJduLEfuf41ohs= X-Google-Smtp-Source: AH8x225mM9ei4mxPnfMCk2xrcSCcnx4hD7zVcprIDGZLmmnrWiPzJbRlj0OjrBbKktmT/VeTVWUM6g== X-Received: by 10.99.107.201 with SMTP id g192mr16197065pgc.295.1516992084151; Fri, 26 Jan 2018 10:41:24 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:200::6:7f96]) by smtp.gmail.com with ESMTPSA id y29sm19627400pff.24.2018.01.26.10.41.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 10:41:23 -0800 (PST) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 01/26] btrfs-progs: get rid of undocumented qgroup inheritance options Date: Fri, 26 Jan 2018 10:40:49 -0800 Message-Id: X-Mailer: git-send-email 2.16.1 In-Reply-To: References: In-Reply-To: References: 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 From: Omar Sandoval The -c option to subvol create and the -c and -x options to subvol snapshot have never been documented (and -x doesn't actually work because it's not in the getopt option string). The functionality is dubious and the kernel interface is being removed, so get rid of these. Signed-off-by: Omar Sandoval --- cmds-subvolume.c | 25 ++----------------------- qgroup.c | 42 ------------------------------------------ qgroup.h | 2 -- 3 files changed, 2 insertions(+), 67 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index dc626a64..f8e34bc8 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -129,18 +129,11 @@ static int cmd_subvol_create(int argc, char **argv) DIR *dirstream = NULL; while (1) { - int c = getopt(argc, argv, "c:i:"); + int c = getopt(argc, argv, "i:"); if (c < 0) 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) { @@ -665,18 +658,11 @@ static int cmd_subvol_snapshot(int argc, char **argv) memset(&args, 0, sizeof(args)); while (1) { - int c = getopt(argc, argv, "c:i:r"); + int c = getopt(argc, argv, "i:r"); if (c < 0) 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 156825fd..e9158a26 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 875fbdf3..bb6610d7 100644 --- a/qgroup.h +++ b/qgroup.h @@ -92,7 +92,5 @@ 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