diff mbox series

[1/4] btrfs: sink gfp_t parameter to btrfs_backref_iter_alloc

Message ID c7040cb687cebc01e3155a330146fd55cc04f6f1.1666103172.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Parameter cleanup | expand

Commit Message

David Sterba Oct. 18, 2022, 2:27 p.m. UTC
There's only one caller that passes GFP_NOFS, we can drop the parameter
an use the flags directly.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/backref.c | 5 ++---
 fs/btrfs/backref.h | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Anand Jain Oct. 20, 2022, 5:56 a.m. UTC | #1
On 18/10/2022 22:27, David Sterba wrote:
> There's only one caller that passes GFP_NOFS, we can drop the parameter
> an use the flags directly.
> 

Compile fails with this patch, needs to update the relocate.c as well.

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();

-Anand


> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>   fs/btrfs/backref.c | 5 ++---
>   fs/btrfs/backref.h | 3 +--
>   2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index e6b69ac1a77c..a5e548f30242 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -2634,12 +2634,11 @@ void free_ipath(struct inode_fs_paths *ipath)
>   	kfree(ipath);
>   }
>   
> -struct btrfs_backref_iter *btrfs_backref_iter_alloc(
> -		struct btrfs_fs_info *fs_info, gfp_t gfp_flag)
> +struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_info)
>   {
>   	struct btrfs_backref_iter *ret;
>   
> -	ret = kzalloc(sizeof(*ret), gfp_flag);
> +	ret = kzalloc(sizeof(*ret), GFP_NOFS);
>   	if (!ret)
>   		return NULL;
>   
> diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
> index 6dac462430b0..ea8b59a201e6 100644
> --- a/fs/btrfs/backref.h
> +++ b/fs/btrfs/backref.h
> @@ -155,8 +155,7 @@ struct btrfs_backref_iter {
>   	u32 end_ptr;
>   };
>   
> -struct btrfs_backref_iter *btrfs_backref_iter_alloc(
> -		struct btrfs_fs_info *fs_info, gfp_t gfp_flag);
> +struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_info);
>   
>   static inline void btrfs_backref_iter_free(struct btrfs_backref_iter *iter)
>   {
diff mbox series

Patch

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index e6b69ac1a77c..a5e548f30242 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -2634,12 +2634,11 @@  void free_ipath(struct inode_fs_paths *ipath)
 	kfree(ipath);
 }
 
-struct btrfs_backref_iter *btrfs_backref_iter_alloc(
-		struct btrfs_fs_info *fs_info, gfp_t gfp_flag)
+struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_backref_iter *ret;
 
-	ret = kzalloc(sizeof(*ret), gfp_flag);
+	ret = kzalloc(sizeof(*ret), GFP_NOFS);
 	if (!ret)
 		return NULL;
 
diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
index 6dac462430b0..ea8b59a201e6 100644
--- a/fs/btrfs/backref.h
+++ b/fs/btrfs/backref.h
@@ -155,8 +155,7 @@  struct btrfs_backref_iter {
 	u32 end_ptr;
 };
 
-struct btrfs_backref_iter *btrfs_backref_iter_alloc(
-		struct btrfs_fs_info *fs_info, gfp_t gfp_flag);
+struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_info);
 
 static inline void btrfs_backref_iter_free(struct btrfs_backref_iter *iter)
 {