From: Omar Sandoval <osandov@osandov.com>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/3] btrfs: qgroup: Remove deprecated feature support in btrfs_qgorup_inhert()
Date: Fri, 7 Sep 2018 13:51:20 -0700 [thread overview]
Message-ID: <20180907205120.GE29245@vader> (raw)
In-Reply-To: <20180831022930.3465-4-wqu@suse.com>
On Fri, Aug 31, 2018 at 10:29:30AM +0800, Qu Wenruo wrote:
> Since btrfs_validate_inherit() will not allow features like copy
> rfer/excl and limit set, remove these dead code.
Reviewed-by: Omar Sandoval <osandov@fb.com>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> fs/btrfs/qgroup.c | 57 +----------------------------------------------
> 1 file changed, 1 insertion(+), 56 deletions(-)
>
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 53daf73b0de9..b57577f45ff3 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -2301,8 +2301,7 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
>
> if (inherit) {
> i_qgroups = (u64 *)(inherit + 1);
> - nums = inherit->num_qgroups + 2 * inherit->num_ref_copies +
> - 2 * inherit->num_excl_copies;
> + nums = inherit->num_qgroups;
> for (i = 0; i < nums; ++i) {
> srcgroup = find_qgroup_rb(fs_info, *i_qgroups);
>
> @@ -2354,23 +2353,6 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
> goto unlock;
> }
>
> - if (inherit && inherit->flags & BTRFS_QGROUP_INHERIT_SET_LIMITS) {
> - dstgroup->lim_flags = inherit->lim.flags;
> - dstgroup->max_rfer = inherit->lim.max_rfer;
> - dstgroup->max_excl = inherit->lim.max_excl;
> - dstgroup->rsv_rfer = inherit->lim.rsv_rfer;
> - dstgroup->rsv_excl = inherit->lim.rsv_excl;
> -
> - ret = update_qgroup_limit_item(trans, dstgroup);
> - if (ret) {
> - fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
> - btrfs_info(fs_info,
> - "unable to update quota limit for %llu",
> - dstgroup->qgroupid);
> - goto unlock;
> - }
> - }
> -
> if (srcid) {
> srcgroup = find_qgroup_rb(fs_info, srcid);
> if (!srcgroup)
> @@ -2413,43 +2395,6 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
> ++i_qgroups;
> }
>
> - for (i = 0; i < inherit->num_ref_copies; ++i, i_qgroups += 2) {
> - struct btrfs_qgroup *src;
> - struct btrfs_qgroup *dst;
> -
> - if (!i_qgroups[0] || !i_qgroups[1])
> - continue;
> -
> - src = find_qgroup_rb(fs_info, i_qgroups[0]);
> - dst = find_qgroup_rb(fs_info, i_qgroups[1]);
> -
> - if (!src || !dst) {
> - ret = -EINVAL;
> - goto unlock;
> - }
> -
> - dst->rfer = src->rfer - level_size;
> - dst->rfer_cmpr = src->rfer_cmpr - level_size;
> - }
> - for (i = 0; i < inherit->num_excl_copies; ++i, i_qgroups += 2) {
> - struct btrfs_qgroup *src;
> - struct btrfs_qgroup *dst;
> -
> - if (!i_qgroups[0] || !i_qgroups[1])
> - continue;
> -
> - src = find_qgroup_rb(fs_info, i_qgroups[0]);
> - dst = find_qgroup_rb(fs_info, i_qgroups[1]);
> -
> - if (!src || !dst) {
> - ret = -EINVAL;
> - goto unlock;
> - }
> -
> - dst->excl = src->excl + level_size;
> - dst->excl_cmpr = src->excl_cmpr + level_size;
> - }
> -
> unlock:
> spin_unlock(&fs_info->qgroup_lock);
> out:
> --
> 2.18.0
>
next prev parent reply other threads:[~2018-09-08 1:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 2:29 [PATCH 0/3] btrfs: qgroup: Deprecate unused features for btrfs_qgroup_inherit() Qu Wenruo
2018-08-31 2:29 ` [PATCH 1/3] btrfs: Set qgroup inherit size limit to SZ_4K instead of page size Qu Wenruo
2018-08-31 2:29 ` [PATCH 2/3] btrfs: qgroup: Validate btrfs_qgroup_inherit structure before passing it to qgroup Qu Wenruo
2018-09-07 20:50 ` Omar Sandoval
2018-09-07 23:33 ` Qu Wenruo
2018-08-31 2:29 ` [PATCH 3/3] btrfs: qgroup: Remove deprecated feature support in btrfs_qgorup_inhert() Qu Wenruo
2018-09-07 20:51 ` Omar Sandoval [this message]
2018-09-05 13:00 ` [PATCH 0/3] btrfs: qgroup: Deprecate unused features for btrfs_qgroup_inherit() David Sterba
2018-09-06 13:25 ` Qu Wenruo
2018-09-07 13:38 ` David Sterba
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=20180907205120.GE29245@vader \
--to=osandov@osandov.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).