]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: use xfs_buf_alloc_pages for uncached buffers
authorDave Chinner <dchinner@redhat.com>
Mon, 12 Jul 2021 21:57:20 +0000 (14:57 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 21:12:10 +0000 (14:12 -0700)
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>
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;