public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Su Yue <l@damenly.su>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com
Subject: Re: [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool
Date: Wed, 13 Oct 2021 14:24:07 +0800	[thread overview]
Message-ID: <fst5igrd.fsf@damenly.su> (raw)
In-Reply-To: <5f0f20b2b0ad9c608357f5f3db27c8e5a9714f80.1634104229.git.anand.jain@oracle.com>


On Wed 13 Oct 2021 at 14:05, Anand Jain <anand.jain@oracle.com> 
wrote:

> btrfs_update_block_group() accounts for the number of bytes 
> allocated or
> freed. Argument %alloc specifies whether the call is for alloc 
> or free.
> Convert the argument %alloc type from int to bool.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>
Reviewed-by: Su Yue <l@damenly.su>

--
Su
> ---
>  fs/btrfs/block-group.c | 2 +-
>  fs/btrfs/block-group.h | 2 +-
>  fs/btrfs/extent-tree.c | 6 +++---
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
> index 46fdef7bbe20..7dba9028c80c 100644
> --- a/fs/btrfs/block-group.c
> +++ b/fs/btrfs/block-group.c
> @@ -3160,7 +3160,7 @@ int btrfs_write_dirty_block_groups(struct 
> btrfs_trans_handle *trans)
>  }
>
>  int btrfs_update_block_group(struct btrfs_trans_handle *trans,
> -			     u64 bytenr, u64 num_bytes, int alloc)
> +			     u64 bytenr, u64 num_bytes, bool alloc)
>  {
>  	struct btrfs_fs_info *info = trans->fs_info;
>  	struct btrfs_block_group *cache = NULL;
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index f751b802b173..07f977d3816c 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -284,7 +284,7 @@ int btrfs_start_dirty_block_groups(struct 
> btrfs_trans_handle *trans);
>  int btrfs_write_dirty_block_groups(struct btrfs_trans_handle 
>  *trans);
>  int btrfs_setup_space_cache(struct btrfs_trans_handle *trans);
>  int btrfs_update_block_group(struct btrfs_trans_handle *trans,
> -			     u64 bytenr, u64 num_bytes, int alloc);
> +			     u64 bytenr, u64 num_bytes, bool alloc);
>  int btrfs_add_reserved_bytes(struct btrfs_block_group *cache,
>  			     u64 ram_bytes, u64 num_bytes, int delalloc);
>  void btrfs_free_reserved_bytes(struct btrfs_block_group *cache,
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index ec5de19f0acd..6e7c03261d78 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -3195,7 +3195,7 @@ static int __btrfs_free_extent(struct 
> btrfs_trans_handle *trans,
>  			goto out;
>  		}
>
> -		ret = btrfs_update_block_group(trans, bytenr, num_bytes, 
> 0);
> +		ret = btrfs_update_block_group(trans, bytenr, num_bytes, 
> false);
>  		if (ret) {
>  			btrfs_abort_transaction(trans, ret);
>  			goto out;
> @@ -4629,7 +4629,7 @@ static int 
> alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
>  	if (ret)
>  		return ret;
>
> -	ret = btrfs_update_block_group(trans, ins->objectid, 
> ins->offset, 1);
> +	ret = btrfs_update_block_group(trans, ins->objectid, 
> ins->offset, true);
>  	if (ret) { /* -ENOENT, logic error */
>  		btrfs_err(fs_info, "update block group failed for %llu 
>  %llu",
>  			ins->objectid, ins->offset);
> @@ -4718,7 +4718,7 @@ static int 
> alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
>  		return ret;
>
>  	ret = btrfs_update_block_group(trans, extent_key.objectid,
> -				       fs_info->nodesize, 1);
> +				       fs_info->nodesize, true);
>  	if (ret) { /* -ENOENT, logic error */
>  		btrfs_err(fs_info, "update block group failed for %llu 
>  %llu",
>  			extent_key.objectid, extent_key.offset);

  reply	other threads:[~2021-10-13  6:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  6:05 [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool Anand Jain
2021-10-13  6:24 ` Su Yue [this message]
2021-10-13  9:15 ` 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=fst5igrd.fsf@damenly.su \
    --to=l@damenly.su \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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