linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/4] btrfs: sink gfp_t parameter to btrfs_qgroup_trace_extent
Date: Thu, 20 Oct 2022 14:01:56 +0800	[thread overview]
Message-ID: <0c79b07b-88bc-0fb1-804d-724e046f6b44@oracle.com> (raw)
In-Reply-To: <851400b247c547bd420dafa4b7ae78345f4a7ae4.1666103172.git.dsterba@suse.com>

On 18/10/2022 22:27, David Sterba wrote:
> All callers pass GFP_NOFS, we can drop the parameter and use it
> directly.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>   fs/btrfs/qgroup.c     | 17 +++++++----------
>   fs/btrfs/qgroup.h     |  2 +-
>   fs/btrfs/relocation.c |  2 +-
>   fs/btrfs/tree-log.c   |  3 +--
>   4 files changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 9334c3157c22..34f0e4dabe25 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -1840,7 +1840,7 @@ int btrfs_qgroup_trace_extent_post(struct btrfs_trans_handle *trans,
>   }
>   
>   int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr,
> -			      u64 num_bytes, gfp_t gfp_flag)
> +			      u64 num_bytes)
>   {
>   	struct btrfs_fs_info *fs_info = trans->fs_info;
>   	struct btrfs_qgroup_extent_record *record;
> @@ -1850,7 +1850,7 @@ int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr,
>   	if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)
>   	    || bytenr == 0 || num_bytes == 0)
>   		return 0;
> -	record = kzalloc(sizeof(*record), gfp_flag);
> +	record = kzalloc(sizeof(*record), GFP_NOFS);
>   	if (!record)
>   		return -ENOMEM;
>   
> @@ -1902,8 +1902,7 @@ int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
>   
>   		num_bytes = btrfs_file_extent_disk_num_bytes(eb, fi);
>   
> -		ret = btrfs_qgroup_trace_extent(trans, bytenr, num_bytes,
> -						GFP_NOFS);
> +		ret = btrfs_qgroup_trace_extent(trans, bytenr, num_bytes);
>   		if (ret)
>   			return ret;
>   	}
> @@ -2102,12 +2101,11 @@ static int qgroup_trace_extent_swap(struct btrfs_trans_handle* trans,
>   	 * blocks for qgroup accounting.
>   	 */
>   	ret = btrfs_qgroup_trace_extent(trans, src_path->nodes[dst_level]->start,
> -			nodesize, GFP_NOFS);
> +					nodesize);
>   	if (ret < 0)
>   		goto out;
> -	ret = btrfs_qgroup_trace_extent(trans,
> -			dst_path->nodes[dst_level]->start,
> -			nodesize, GFP_NOFS);
> +	ret = btrfs_qgroup_trace_extent(trans, dst_path->nodes[dst_level]->start,
> +					nodesize);
>   	if (ret < 0)
>   		goto out;
>   
> @@ -2391,8 +2389,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
>   			path->locks[level] = BTRFS_READ_LOCK;
>   
>   			ret = btrfs_qgroup_trace_extent(trans, child_bytenr,
> -							fs_info->nodesize,
> -							GFP_NOFS);
> +							fs_info->nodesize);
>   			if (ret)
>   				goto out;
>   		}
> diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
> index 3fb5459c9309..7bffa10589d6 100644
> --- a/fs/btrfs/qgroup.h
> +++ b/fs/btrfs/qgroup.h
> @@ -321,7 +321,7 @@ int btrfs_qgroup_trace_extent_post(struct btrfs_trans_handle *trans,
>    * (NULL trans)
>    */
>   int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr,
> -			      u64 num_bytes, gfp_t gfp_flag);
> +			      u64 num_bytes);
>   
>   /*
>    * Inform qgroup to trace all leaf items of data



> diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
> index 216a4485d914..f5564aa313f5 100644
> --- a/fs/btrfs/relocation.c
> +++ b/fs/btrfs/relocation.c
> @@ -471,7 +471,7 @@ static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
>   	int ret;
>   	int err = 0;
>   
> -	iter = btrfs_backref_iter_alloc(rc->extent_root->fs_info, GFP_NOFS);
> +	iter = btrfs_backref_iter_alloc(rc->extent_root->fs_info);
>   	if (!iter)
>   		return ERR_PTR(-ENOMEM);
>   	path = btrfs_alloc_path();


  This change should be part of the patch 1/4.
  Except that, rest looks good.


-Anand

> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index 813986e38258..3b44b325aba6 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -747,8 +747,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
>   		 */
>   		ret = btrfs_qgroup_trace_extent(trans,
>   				btrfs_file_extent_disk_bytenr(eb, item),
> -				btrfs_file_extent_disk_num_bytes(eb, item),
> -				GFP_NOFS);
> +				btrfs_file_extent_disk_num_bytes(eb, item));
>   		if (ret < 0)
>   			goto out;
>   


  reply	other threads:[~2022-10-20  6:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 14:27 [PATCH 0/4] Parameter cleanup David Sterba
2022-10-18 14:27 ` [PATCH 1/4] btrfs: sink gfp_t parameter to btrfs_backref_iter_alloc David Sterba
2022-10-20  5:56   ` Anand Jain
2022-10-18 14:27 ` [PATCH 2/4] btrfs: sink gfp_t parameter to btrfs_qgroup_trace_extent David Sterba
2022-10-20  6:01   ` Anand Jain [this message]
2022-10-20 16:39     ` David Sterba
2022-10-18 14:27 ` [PATCH 3/4] btrfs: switch GFP_NOFS to GFP_KERNEL in scrub_setup_recheck_block David Sterba
2022-10-20  7:27   ` Anand Jain
2022-10-20 16:35     ` David Sterba
2022-10-21  2:34       ` Anand Jain
2022-10-18 14:27 ` [PATCH 4/4] btrfs: sink gfp_t parameter to alloc_scrub_sector David Sterba
2022-10-20  7:30   ` Anand Jain
2022-10-19 10:28 ` [PATCH 0/4] Parameter cleanup Johannes Thumshirn
2022-10-19 15:16   ` David Sterba
2022-10-19 15:23     ` Johannes Thumshirn
2022-10-19 16:05       ` 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=0c79b07b-88bc-0fb1-804d-724e046f6b44@oracle.com \
    --to=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;
as well as URLs for NNTP newsgroup(s).