Commit 5c40e050 authored by Michal Hocko's avatar Michal Hocko Committed by Christian Brauner
Browse files

fs: drop GFP_NOFAIL mode from alloc_page_buffers



There is only one called of alloc_page_buffers and it doesn't require
__GFP_NOFAIL so drop this allocation mode.

Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
Link: https://lore.kernel.org/r/20240829130640.1397970-1-mhocko@kernel.org


Acked-by: default avatarSong Liu <song@kernel.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 459ca85a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ static int read_file_page(struct file *file, unsigned long index,
	pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE,
		 (unsigned long long)index << PAGE_SHIFT);

	bh = alloc_page_buffers(page, blocksize, false);
	bh = alloc_page_buffers(page, blocksize);
	if (!bh) {
		ret = -ENOMEM;
		goto out;
+1 −4
Original line number Diff line number Diff line
@@ -957,12 +957,9 @@ struct buffer_head *folio_alloc_buffers(struct folio *folio, unsigned long size,
}
EXPORT_SYMBOL_GPL(folio_alloc_buffers);

struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
				       bool retry)
struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size)
{
	gfp_t gfp = GFP_NOFS | __GFP_ACCOUNT;
	if (retry)
		gfp |= __GFP_NOFAIL;

	return folio_alloc_buffers(page_folio(page), size, gfp);
}
+1 −2
Original line number Diff line number Diff line
@@ -199,8 +199,7 @@ void folio_set_bh(struct buffer_head *bh, struct folio *folio,
		  unsigned long offset);
struct buffer_head *folio_alloc_buffers(struct folio *folio, unsigned long size,
					gfp_t gfp);
struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
		bool retry);
struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size);
struct buffer_head *create_empty_buffers(struct folio *folio,
		unsigned long blocksize, unsigned long b_state);
void end_buffer_read_sync(struct buffer_head *bh, int uptodate);