From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Mark Harmstone <maharmstone@fb.com>, linux-btrfs@vger.kernel.org
Cc: Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH v2 3/3] btrfs-progs: remove unused qgroup functions
Date: Sun, 4 Aug 2024 17:22:14 +0930 [thread overview]
Message-ID: <26d4dffc-0d90-408e-a2f6-059a5203856f@gmx.com> (raw)
In-Reply-To: <20240802112730.3575159-4-maharmstone@fb.com>
在 2024/8/2 20:57, Mark Harmstone 写道:
> From: Omar Sandoval <osandov@fb.com>
>
> Remove functions that after the previous two patches are no longer
> referenced.
>
> Signed-off-by: Mark Harmstone <maharmstone@fb.com>
> Co-authored-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
qu
> ---
> cmds/qgroup.c | 64 ---------------------------------------------------
> cmds/qgroup.h | 2 --
> 2 files changed, 66 deletions(-)
>
> diff --git a/cmds/qgroup.c b/cmds/qgroup.c
> index 20b97f7a..57052861 100644
> --- a/cmds/qgroup.c
> +++ b/cmds/qgroup.c
> @@ -1688,70 +1688,6 @@ out:
> return ret;
> }
>
> -int btrfs_qgroup_inherit_size(struct btrfs_qgroup_inherit *p)
> -{
> - return sizeof(*p) + sizeof(p->qgroups[0]) *
> - (p->num_qgroups + 2 * p->num_ref_copies +
> - 2 * p->num_excl_copies);
> -}
> -
> -static int qgroup_inherit_realloc(struct btrfs_qgroup_inherit **inherit, int n,
> - int pos)
> -{
> - struct btrfs_qgroup_inherit *out;
> - int nitems = 0;
> -
> - if (*inherit) {
> - nitems = (*inherit)->num_qgroups +
> - (*inherit)->num_ref_copies +
> - (*inherit)->num_excl_copies;
> - }
> -
> - out = calloc(1, sizeof(*out) + sizeof(out->qgroups[0]) * (nitems + n));
> - if (out == NULL) {
> - error_msg(ERROR_MSG_MEMORY, NULL);
> - return -ENOMEM;
> - }
> -
> - if (*inherit) {
> - struct btrfs_qgroup_inherit *i = *inherit;
> - int s = sizeof(out->qgroups[0]);
> -
> - out->num_qgroups = i->num_qgroups;
> - out->num_ref_copies = i->num_ref_copies;
> - out->num_excl_copies = i->num_excl_copies;
> - memcpy(out->qgroups, i->qgroups, pos * s);
> - memcpy(out->qgroups + pos + n, i->qgroups + pos,
> - (nitems - pos) * s);
> - }
> - free(*inherit);
> - *inherit = out;
> -
> - return 0;
> -}
> -
> -int btrfs_qgroup_inherit_add_group(struct btrfs_qgroup_inherit **inherit, char *arg)
> -{
> - int ret;
> - u64 qgroupid = parse_qgroupid_or_path(arg);
> - int pos = 0;
> -
> - if (qgroupid == 0) {
> - error("invalid qgroup specification, qgroupid must not 0");
> - return -EINVAL;
> - }
> -
> - if (*inherit)
> - pos = (*inherit)->num_qgroups;
> - ret = qgroup_inherit_realloc(inherit, 1, pos);
> - if (ret)
> - return ret;
> -
> - (*inherit)->qgroups[(*inherit)->num_qgroups++] = qgroupid;
> -
> - 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 1fc10722..32309ce4 100644
> --- a/cmds/qgroup.h
> +++ b/cmds/qgroup.h
> @@ -36,8 +36,6 @@ struct btrfs_qgroup_stats {
> struct btrfs_qgroup_limit limit;
> };
>
> -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_query(int fd, u64 qgroupid, struct btrfs_qgroup_stats *stats);
>
> #endif
next prev parent reply other threads:[~2024-08-04 7:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 11:27 [PATCH v2 0/3] btrfs-progs: use libbtrfsutil for subvolume creation Mark Harmstone
2024-08-02 11:27 ` [PATCH v2 1/3] btrfs-progs: use libbtrfsutil for btrfs subvolume create Mark Harmstone
2024-08-04 7:54 ` Qu Wenruo
2024-08-02 11:27 ` [PATCH v2 2/3] btrfs-progs: use libbtrfsutil for btrfs subvolume snapshot Mark Harmstone
2024-08-04 7:54 ` Qu Wenruo
2024-08-02 11:27 ` [PATCH v2 3/3] btrfs-progs: remove unused qgroup functions Mark Harmstone
2024-08-04 7:52 ` Qu Wenruo [this message]
2024-08-02 13:17 ` [PATCH v2 0/3] btrfs-progs: use libbtrfsutil for subvolume creation Neal Gompa
2024-08-05 0:46 ` Qu Wenruo
2024-08-06 16:41 ` Mark Harmstone
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=26d4dffc-0d90-408e-a2f6-059a5203856f@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=maharmstone@fb.com \
--cc=osandov@fb.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