[PATCH 8/9] xfs: set btree block buffer ops in _init_buf

Darrick J. Wong
2023-12-31T22:21:51Z

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>
---
libxfs/xfbtree.c | 1 -
libxfs/xfs_bmap.c | 1 -
libxfs/xfs_btree.c | 1 +
3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/libxfs/xfbtree.c b/libxfs/xfbtree.c
index 7310f29a8c2..d76b3d5ea70 100644
--- a/libxfs/xfbtree.c
+++ b/libxfs/xfbtree.c
@@ -401,7 +401,6 @@ xfbtree_init_leaf_block(

trace_xfbtree_create_root_buf(xfbt, bp);

- bp->b_ops = cfg->btree_ops->buf_ops;
xfs_btree_init_buf(mp, bp, cfg->btree_ops, 0, 0, cfg->owner);
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index 46551021755..9a2cb5662d1 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -681,7 +681,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_btree_init_buf(mp, abp, &xfs_bmbt_ops, 0, 0, ip->i_ino);

diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 218e96d7976..6705a6d83f3 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -1275,6 +1275,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