Skip to content

Commit fea9113

Browse files
adam900710kdave
authored andcommitted
btrfs: remove the extra_gfp parameter from btrfs_alloc_folio_array()
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. Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 32e6216 commit fea9113

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

fs/btrfs/compression.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ void btrfs_submit_compressed_read(struct btrfs_bio *bbio)
609609
goto out_free_bio;
610610
}
611611

612-
ret2 = btrfs_alloc_folio_array(cb->nr_folios, cb->compressed_folios, 0);
612+
ret2 = btrfs_alloc_folio_array(cb->nr_folios, cb->compressed_folios);
613613
if (ret2) {
614614
ret = BLK_STS_RESOURCE;
615615
goto out_free_compressed_pages;

fs/btrfs/extent_io.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,24 +667,22 @@ static void end_bbio_data_read(struct btrfs_bio *bbio)
667667
}
668668

669669
/*
670-
* Populate every free slot in a provided array with folios.
670+
* Populate every free slot in a provided array with folios using GFP_NOFS.
671671
*
672672
* @nr_folios: number of folios to allocate
673673
* @folio_array: the array to fill with folios; any existing non-NULL entries in
674674
* the array will be skipped
675-
* @extra_gfp: the extra GFP flags for the allocation
676675
*
677676
* Return: 0 if all folios were able to be allocated;
678677
* -ENOMEM otherwise, the partially allocated folios would be freed and
679678
* the array slots zeroed
680679
*/
681-
int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array,
682-
gfp_t extra_gfp)
680+
int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array)
683681
{
684682
for (int i = 0; i < nr_folios; i++) {
685683
if (folio_array[i])
686684
continue;
687-
folio_array[i] = folio_alloc(GFP_NOFS | extra_gfp, 0);
685+
folio_array[i] = folio_alloc(GFP_NOFS, 0);
688686
if (!folio_array[i])
689687
goto error;
690688
}

fs/btrfs/extent_io.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ void btrfs_clear_buffer_dirty(struct btrfs_trans_handle *trans,
365365

366366
int btrfs_alloc_page_array(unsigned int nr_pages, struct page **page_array,
367367
gfp_t extra_gfp);
368-
int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array,
369-
gfp_t extra_gfp);
368+
int btrfs_alloc_folio_array(unsigned int nr_folios, struct folio **folio_array);
370369

371370
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
372371
bool find_lock_delalloc_range(struct inode *inode,

0 commit comments

Comments
 (0)