]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: use xfs_buf_alloc_pages for uncached buffers
authorDave Chinner <dchinner@redhat.com>
Thu, 14 Oct 2021 16:35:45 +0000 (12:35 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 14 Oct 2021 16:35:45 +0000 (12:35 -0400)
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 <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ag.c

index cf4d65a387ad5408681b5b407824cefccacff72d..b94ad5c3c2cc73b2d4ddaffb5d78e6f2baf37710 100644 (file)
@@ -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;