linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: qgroups: Prepare to deprecate BTRFS_QGROUP_LIMIT_RSV_RFER/EXCL flags
Date: Tue, 13 Nov 2018 11:48:18 +0200	[thread overview]
Message-ID: <5123074e-c78d-5324-c6be-91a5a25d4426@suse.com> (raw)
In-Reply-To: <20181113060909.27605-1-wqu@suse.com>



On 13.11.18 г. 8:09 ч., Qu Wenruo wrote:
> These two flags are only used to set btrfs_qgroup::rsv_rfer/excl number,
> but then are never used.
> 
> Nor these flags are really used by btrfs-progs, so it's pretty safe just
> to deprecate them in next kernel release.
> 
> This patch will mark these two flags deprecated and output warning
> messages, but still handle them.
> 
> These two flags will be completely removed in next kernel release.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  fs/btrfs/qgroup.c          | 16 ++++++++++------
>  include/uapi/linux/btrfs.h | 12 ++++++------
>  2 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 9afad8c14220..d4a52dbad044 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -1385,21 +1385,25 @@ int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,
>  			qgroup->max_excl = limit->max_excl;
>  		}
>  	}
> -	if (limit->flags & BTRFS_QGROUP_LIMIT_RSV_RFER) {
> +	if (limit->flags & __BTRFS_QGROUP_LIMIT_RSV_RFER) {
>  		if (limit->rsv_rfer == CLEAR_VALUE) {
> -			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_RSV_RFER;
> -			limit->flags &= ~BTRFS_QGROUP_LIMIT_RSV_RFER;
> +			qgroup->lim_flags &= ~__BTRFS_QGROUP_LIMIT_RSV_RFER;
> +			limit->flags &= ~__BTRFS_QGROUP_LIMIT_RSV_RFER;
>  			qgroup->rsv_rfer = 0;
>  		} else {
> +			btrfs_warn_rl(fs_info,
> +"BTRFS_QGROUP_LIMIT_RSV_RFER flag is deprecated, will not be supported in v5.1");
>  			qgroup->rsv_rfer = limit->rsv_rfer;
>  		}
>  	}
> -	if (limit->flags & BTRFS_QGROUP_LIMIT_RSV_EXCL) {
> +	if (limit->flags & __BTRFS_QGROUP_LIMIT_RSV_EXCL) {
>  		if (limit->rsv_excl == CLEAR_VALUE) {
> -			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_RSV_EXCL;
> -			limit->flags &= ~BTRFS_QGROUP_LIMIT_RSV_EXCL;
> +			qgroup->lim_flags &= ~__BTRFS_QGROUP_LIMIT_RSV_EXCL;
> +			limit->flags &= ~__BTRFS_QGROUP_LIMIT_RSV_EXCL;
>  			qgroup->rsv_excl = 0;
>  		} else {
> +			btrfs_warn_rl(fs_info,
> +"BTRFS_QGROUP_LIMIT_RSV_EXCL flag is deprecated, will not be supported in v5.1");
>  			qgroup->rsv_excl = limit->rsv_excl;
>  		}
>  	}
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index db4c253f8011..ec79ab781ee0 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -53,12 +53,12 @@ struct btrfs_ioctl_vol_args {
>   * struct btrfs_qgroup_limit.flags
>   * struct btrfs_qgroup_limit_item.flags
>   */
> -#define BTRFS_QGROUP_LIMIT_MAX_RFER	(1ULL << 0)
> -#define BTRFS_QGROUP_LIMIT_MAX_EXCL	(1ULL << 1)
> -#define BTRFS_QGROUP_LIMIT_RSV_RFER	(1ULL << 2)
> -#define BTRFS_QGROUP_LIMIT_RSV_EXCL	(1ULL << 3)
> -#define BTRFS_QGROUP_LIMIT_RFER_CMPR	(1ULL << 4)
> -#define BTRFS_QGROUP_LIMIT_EXCL_CMPR	(1ULL << 5)
> +#define BTRFS_QGROUP_LIMIT_MAX_RFER	(1ULL << 0) /* reference (rfer) limit */
> +#define BTRFS_QGROUP_LIMIT_MAX_EXCL	(1ULL << 1) /* exclusive (excl) limit */
> +#define __BTRFS_QGROUP_LIMIT_RSV_RFER	(1ULL << 2) /* deprecated */
> +#define __BTRFS_QGROUP_LIMIT_RSV_EXCL	(1ULL << 3) /* deprecated */

We gain absolutely nothing by prepending the __, drop it. What's
sufficient for this patch is to introduce only the warnings, nothing else.

> +#define BTRFS_QGROUP_LIMIT_RFER_CMPR	(1ULL << 4) /* compressed rfer limit */
> +#define BTRFS_QGROUP_LIMIT_EXCL_CMPR	(1ULL << 5) /* compressed excl limit */
>  
>  struct btrfs_qgroup_limit {
>  	__u64	flags;
> 

  reply	other threads:[~2018-11-13  9:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13  6:09 [PATCH] btrfs: qgroups: Prepare to deprecate BTRFS_QGROUP_LIMIT_RSV_RFER/EXCL flags Qu Wenruo
2018-11-13  9:48 ` Nikolay Borisov [this message]
2018-11-13 10:07   ` Qu Wenruo

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=5123074e-c78d-5324-c6be-91a5a25d4426@suse.com \
    --to=nborisov@suse.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).