From: Dave Chinner Date: Mon, 7 Jun 2021 01:50:17 +0000 (+1000) Subject: xfs: get rid of xb_to_gfp() X-Git-Tag: v5.14-rc1~97^2~36^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=289ae7b48c2c4d9bec515e720c01146498109dee;p=thirdparty%2Fkernel%2Flinux.git xfs: get rid of xb_to_gfp() Only used in one place, so just open code the logic in the macro. Based on a patch from Christoph Hellwig. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 5c6a7140d28de..0b0d66d315157 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -22,9 +22,6 @@ static kmem_zone_t *xfs_buf_zone; -#define xb_to_gfp(flags) \ - ((((flags) & XBF_READ_AHEAD) ? __GFP_NORETRY : GFP_NOFS) | __GFP_NOWARN) - /* * Locking orders * @@ -350,9 +347,14 @@ xfs_buf_alloc_pages( struct xfs_buf *bp, xfs_buf_flags_t flags) { - gfp_t gfp_mask = xb_to_gfp(flags); + gfp_t gfp_mask = __GFP_NOWARN; long filled = 0; + if (flags & XBF_READ_AHEAD) + gfp_mask |= __GFP_NORETRY; + else + gfp_mask |= GFP_NOFS; + /* Make sure that we have a page list */ bp->b_page_count = DIV_ROUND_UP(BBTOB(bp->b_length), PAGE_SIZE); if (bp->b_page_count <= XB_PAGES) {