diff mbox series

[1/2] btrfs: remove the extra_gfp parameter from btrfs_alloc_folio_array()

Message ID 526ad2f2f231241f705af275e8d0ffc52c442e4f.1719462554.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: cleanup on the extra_gfp parameters | expand

Commit Message

Qu Wenruo June 27, 2024, 4:31 a.m. UTC
The function btrfs_alloc_folio_array() is only utilized in
btrfs_submit_compressed_read() and no other location, and the only
caller is not utilizing the @extra_gfp parameter.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/compression.c | 2 +-
 fs/btrfs/extent_io.c   | 8 +++-----
 fs/btrfs/extent_io.h   | 3 +--
 3 files changed, 5 insertions(+), 8 deletions(-)

Comments

Filipe Manana June 27, 2024, 8:51 a.m. UTC | #1
On Thu, Jun 27, 2024 at 5:32 AM Qu Wenruo <wqu@suse.com> wrote:
>
> The function btrfs_alloc_folio_array() is only utilized in
> btrfs_submit_compressed_read() and no other location, and the only
> caller is not utilizing the @extra_gfp parameter.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good, thanks.

> ---
>  fs/btrfs/compression.c | 2 +-
>  fs/btrfs/extent_io.c   | 8 +++-----
>  fs/btrfs/extent_io.h   | 3 +--
>  3 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index 85eb2cadbbf6..a149f3659b15 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -609,7 +609,7 @@ void btrfs_submit_compressed_read(struct btrfs_bio *bbio)
>                 goto out_free_bio;
>         }
>
> -       ret2 = btrfs_alloc_folio_array(cb->nr_folios, cb->compressed_folios, 0);
> +       ret2 = btrfs_alloc_folio_array(cb->nr_folios, cb->compressed_folios);
>         if (ret2) {
>                 ret = BLK_STS_RESOURCE;
>                 goto out_free_compressed_pages;
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index c7a9284e45e1..dc416bad9ad8 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -667,24 +667,22 @@ static void end_bbio_data_read(struct btrfs_bio *bbio)
>  }
>
>  /*
> - * Populate every free slot in a provided array with folios.
> + * Populate every free slot in a provided array with folios using GFP_NOFS.
>   *
>   * @nr_folios:   number of folios to allocate
>   * @folio_array: the array to fill with folios; any existing non-NULL entries in
>   *              the array will be skipped
> - * @extra_gfp:  the extra GFP flags for the allocation
>   *
>   * Return: 0        if all folios were able to be allocated;
>   *         -ENOMEM  otherwise, the partially allocated folios would be freed and
>   *                  the array slots zeroed
>   */
> -int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array,
> -                           gfp_t extra_gfp)
> +int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array)
>  {
>         for (int i = 0; i < nr_folios; i++) {
>                 if (folio_array[i])
>                         continue;
> -               folio_array[i] = folio_alloc(GFP_NOFS | extra_gfp, 0);
> +               folio_array[i] = folio_alloc(GFP_NOFS, 0);
>                 if (!folio_array[i])
>                         goto error;
>         }
> diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
> index 8b33cfea6b75..8364dcb1ace3 100644
> --- a/fs/btrfs/extent_io.h
> +++ b/fs/btrfs/extent_io.h
> @@ -365,8 +365,7 @@ void btrfs_clear_buffer_dirty(struct btrfs_trans_handle *trans,
>
>  int btrfs_alloc_page_array(unsigned int nr_pages, struct page **page_array,
>                            gfp_t extra_gfp);
> -int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array,
> -                           gfp_t extra_gfp);
> +int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array);
>
>  #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
>  bool find_lock_delalloc_range(struct inode *inode,
> --
> 2.45.2
>
>
diff mbox series

Patch

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 85eb2cadbbf6..a149f3659b15 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -609,7 +609,7 @@  void btrfs_submit_compressed_read(struct btrfs_bio *bbio)
 		goto out_free_bio;
 	}
 
-	ret2 = btrfs_alloc_folio_array(cb->nr_folios, cb->compressed_folios, 0);
+	ret2 = btrfs_alloc_folio_array(cb->nr_folios, cb->compressed_folios);
 	if (ret2) {
 		ret = BLK_STS_RESOURCE;
 		goto out_free_compressed_pages;
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index c7a9284e45e1..dc416bad9ad8 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -667,24 +667,22 @@  static void end_bbio_data_read(struct btrfs_bio *bbio)
 }
 
 /*
- * Populate every free slot in a provided array with folios.
+ * Populate every free slot in a provided array with folios using GFP_NOFS.
  *
  * @nr_folios:   number of folios to allocate
  * @folio_array: the array to fill with folios; any existing non-NULL entries in
  *		 the array will be skipped
- * @extra_gfp:	 the extra GFP flags for the allocation
  *
  * Return: 0        if all folios were able to be allocated;
  *         -ENOMEM  otherwise, the partially allocated folios would be freed and
  *                  the array slots zeroed
  */
-int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array,
-			    gfp_t extra_gfp)
+int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array)
 {
 	for (int i = 0; i < nr_folios; i++) {
 		if (folio_array[i])
 			continue;
-		folio_array[i] = folio_alloc(GFP_NOFS | extra_gfp, 0);
+		folio_array[i] = folio_alloc(GFP_NOFS, 0);
 		if (!folio_array[i])
 			goto error;
 	}
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 8b33cfea6b75..8364dcb1ace3 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -365,8 +365,7 @@  void btrfs_clear_buffer_dirty(struct btrfs_trans_handle *trans,
 
 int btrfs_alloc_page_array(unsigned int nr_pages, struct page **page_array,
 			   gfp_t extra_gfp);
-int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array,
-			    gfp_t extra_gfp);
+int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array);
 
 #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
 bool find_lock_delalloc_range(struct inode *inode,