public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, linux-btrfs@vger.kernel.org
Cc: Sidong Yang <realwakka@gmail.com>
Subject: [PATCH v2 2/2] btrfs-progs: qgroup: remove unused btrfs_qgroup_inherit_add_group()
Date: Wed,  9 Mar 2022 15:16:07 +0000	[thread overview]
Message-ID: <20220309151607.48650-2-realwakka@gmail.com> (raw)
In-Reply-To: <20220309151607.48650-1-realwakka@gmail.com>

The function btrfs_qgroup_inherit_add_group() was used for options in
create subvolume '-c' or snapshot '-c' or '-x' command. These options
are deleted and the function is not needed everywhere now. So we can
delete it.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
---
 cmds/qgroup.c | 41 -----------------------------------------
 cmds/qgroup.h |  2 --
 2 files changed, 43 deletions(-)

diff --git a/cmds/qgroup.c b/cmds/qgroup.c
index 139dca97..3f59ba05 100644
--- a/cmds/qgroup.c
+++ b/cmds/qgroup.c
@@ -1477,47 +1477,6 @@ int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *
 	return 0;
 }
 
-int btrfs_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_or_path(arg);
-	qgroup_dst = parse_qgroupid_or_path(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;
-}
 static const char * const qgroup_cmd_group_usage[] = {
 	"btrfs qgroup <command> [options] <path>",
 	NULL
diff --git a/cmds/qgroup.h b/cmds/qgroup.h
index 69b8c11f..f30cb8a8 100644
--- a/cmds/qgroup.h
+++ b/cmds/qgroup.h
@@ -38,8 +38,6 @@ struct btrfs_qgroup_stats {
 
 int btrfs_qgroup_inherit_size(struct btrfs_qgroup_inherit *p);
 int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg);
-int btrfs_qgroup_inherit_add_copy(struct btrfs_qgroup_inherit **inherit, char *arg,
-			    int type);
 int btrfs_qgroup_query(int fd, u64 qgroupid, struct btrfs_qgroup_stats *stats);
 
 #endif
-- 
2.25.1


      reply	other threads:[~2022-03-09 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 15:16 [PATCH v2 1/2] btrfs-progs: subvolme: remove unused options for create and snapshot Sidong Yang
2022-03-09 15:16 ` Sidong Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220309151607.48650-2-realwakka@gmail.com \
    --to=realwakka@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox