]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: simplify the failure path in xfs_buf_alloc_vmalloc
authorChristoph Hellwig <hch@lst.de>
Wed, 17 Jun 2026 05:58:05 +0000 (07:58 +0200)
committerCarlos Maiolino <cem@kernel.org>
Mon, 29 Jun 2026 07:37:06 +0000 (09:37 +0200)
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 <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c

index 4cf2a154dba8a9299aa2de5ab7e3477af49553a3..2a7d696d394a01c7b486a8472b9f8727284d4127 100644 (file)
@@ -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);
        }
 
        /*