From: Dave Chinner Date: Thu, 14 Oct 2021 16:35:45 +0000 (-0400) Subject: xfs: use xfs_buf_alloc_pages for uncached buffers X-Git-Tag: libxfs-5.14-sync_2021-10-16~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bba7995ac33779730eae2c8787ec4f7f2e1432f;p=thirdparty%2Fxfsprogs-dev.git xfs: use xfs_buf_alloc_pages for uncached buffers Source kernel commit: 07b5c5add42a0afccf79401b12d78043ed6b8240 Use the newly factored out page allocation code. This adds automatic buffer zeroing for non-read uncached buffers. This also allows us to greatly simply the error handling in xfs_buf_get_uncached(). Because xfs_buf_alloc_pages() cleans up partial allocation failure, we can just call xfs_buf_free() in all error cases now to clean up after failures. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_ag.c b/libxfs/xfs_ag.c index cf4d65a38..b94ad5c3c 100644 --- a/libxfs/xfs_ag.c +++ b/libxfs/xfs_ag.c @@ -42,7 +42,6 @@ xfs_get_aghdr_buf( if (error) return error; - xfs_buf_zero(bp, 0, BBTOB(bp->b_length)); bp->b_bn = blkno; bp->b_maps[0].bm_bn = blkno; bp->b_ops = ops;