xfs: set btree block buffer ops in _init_buf
authorDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:35:19 +0000 (12:35 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:35:19 +0000 (12:35 -0800)
Set the btree block buffer ops in xfs_btree_init_buf since we already
have access to that information through the btree ops.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_btree.c

index 995b9ea55cd44c68dc76260bb13bc5a25987ecad..c196fd0a3d7e5d5cb74098f878ca71477e320cc8 100644 (file)
@@ -688,7 +688,6 @@ xfs_bmap_extents_to_btree(
        /*
         * Fill in the child block.
         */
-       abp->b_ops = &xfs_bmbt_buf_ops;
        ablock = XFS_BUF_TO_BLOCK(abp);
        xfs_bmbt_init_block(ip, ablock, abp, 0, 0);
 
index b5b9b021c67ab8da8a6670e76268f0d28aec9058..e945620b22031619e24d9086cbd4a62285a9884c 100644 (file)
@@ -1219,6 +1219,7 @@ xfs_btree_init_buf(
 {
        __xfs_btree_init_block(mp, XFS_BUF_TO_BLOCK(bp), ops,
                        xfs_buf_daddr(bp), level, numrecs, owner);
+       bp->b_ops = ops->buf_ops;
 }
 
 void