From: Christoph Hellwig Date: Wed, 17 Jun 2026 05:58:05 +0000 (+0200) Subject: xfs: simplify the failure path in xfs_buf_alloc_vmalloc X-Git-Tag: v7.2-rc2~15^2~10 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=19dc95d4b6cf81e1878a3abd587afc967b75d5ce;p=thirdparty%2Flinux.git xfs: simplify the failure path in xfs_buf_alloc_vmalloc Look at the __GFP_NORETRY flag set for readahead so that we don't have to pass both the gfp_t and the flags in. Signed-off-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Signed-off-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 4cf2a154dba8..2a7d696d394a 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -168,14 +168,13 @@ static int xfs_buf_alloc_vmalloc( struct xfs_buf *bp, size_t size, - gfp_t gfp_mask, - xfs_buf_flags_t flags) + gfp_t gfp_mask) { for (;;) { bp->b_addr = __vmalloc(size, gfp_mask); if (bp->b_addr) break; - if (flags & XBF_READ_AHEAD) + if (gfp_mask & __GFP_NORETRY) return -ENOMEM; XFS_STATS_INC(bp->b_mount, xb_page_retries); memalloc_retry_wait(gfp_mask); @@ -244,7 +243,7 @@ xfs_buf_alloc_backing_mem( return 0; trace_xfs_buf_backing_fallback(bp, _RET_IP_); } - return xfs_buf_alloc_vmalloc(bp, size, gfp_mask, flags); + return xfs_buf_alloc_vmalloc(bp, size, gfp_mask); } /*