mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
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 <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
0144bcf619
commit
19dc95d4b6
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user