[PATCH 056/110] xfs: remove xfs_inobt_stage_cursor

Darrick J. Wong
2024-03-26T03:43:02Z

From: Christoph Hellwig <hch@lst.de>

Source kernel commit: 6234dee7e6f58676379f3a2d8b0629a6e9a427fd

Just open code the two calls in the callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
libxfs/libxfs_api_defs.h | 1 +
libxfs/xfs_ialloc_btree.c | 14 --------------
libxfs/xfs_ialloc_btree.h | 2 --
repair/agbtree.c | 8 +++++---
4 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
index 9a2968906c42..2adf20ce8a41 100644
--- a/libxfs/libxfs_api_defs.h
+++ b/libxfs/libxfs_api_defs.h
@@ -147,6 +147,7 @@
#define xfs_initialize_perag_data libxfs_initialize_perag_data
#define xfs_init_local_fork libxfs_init_local_fork

+#define xfs_inobt_init_cursor libxfs_inobt_init_cursor
#define xfs_inobt_maxrecs libxfs_inobt_maxrecs
#define xfs_inobt_stage_cursor libxfs_inobt_stage_cursor
#define xfs_inode_from_disk libxfs_inode_from_disk
diff --git a/libxfs/xfs_ialloc_btree.c b/libxfs/xfs_ialloc_btree.c
index aa3f586dab01..6a34de28293b 100644
--- a/libxfs/xfs_ialloc_btree.c
+++ b/libxfs/xfs_ialloc_btree.c
@@ -488,20 +488,6 @@ xfs_inobt_init_cursor(
return cur;
}

-/* Create an inode btree cursor with a fake root for staging. */
-struct xfs_btree_cur *
-xfs_inobt_stage_cursor(
- struct xfs_perag *pag,
- struct xbtree_afakeroot *afake,
- xfs_btnum_t btnum)
-{
- struct xfs_btree_cur *cur;
-
- cur = xfs_inobt_init_cursor(pag, NULL, NULL, btnum);
- xfs_btree_stage_afakeroot(cur, afake);
- return cur;
-}
-
/*
* Install a new inobt btree root. Caller is responsible for invalidating
* and freeing the old btree blocks.
diff --git a/libxfs/xfs_ialloc_btree.h b/libxfs/xfs_ialloc_btree.h
index 3262c3fe5ebe..40f0fc0e8da3 100644
--- a/libxfs/xfs_ialloc_btree.h
+++ b/libxfs/xfs_ialloc_btree.h
@@ -48,8 +48,6 @@ struct xfs_perag;

extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_perag *pag,
struct xfs_trans *tp, struct xfs_buf *agbp, xfs_btnum_t btnum);
-struct xfs_btree_cur *xfs_inobt_stage_cursor(struct xfs_perag *pag,
- struct xbtree_afakeroot *afake, xfs_btnum_t btnum);
extern int xfs_inobt_maxrecs(struct xfs_mount *, int, int);

/* ir_holemask to inode allocation bitmap conversion */
diff --git a/repair/agbtree.c b/repair/agbtree.c
index d5fa4eafb633..22e31c47a827 100644
--- a/repair/agbtree.c
+++ b/repair/agbtree.c
@@ -524,8 +524,9 @@ init_ino_cursors(
fino_recs++;
}

- btr_ino->cur = libxfs_inobt_stage_cursor(pag, &btr_ino->newbt.afake,
+ btr_ino->cur = libxfs_inobt_init_cursor(pag, NULL, NULL,
XFS_BTNUM_INO);
+ libxfs_btree_stage_afakeroot(btr_ino->cur, &btr_ino->newbt.afake);

btr_ino->bload.get_records = get_inobt_records;
btr_ino->bload.claim_block = rebuild_claim_block;
@@ -544,8 +545,9 @@ _("Unable to compute inode btree geometry, error %d.\n"), error);
return;

init_rebuild(sc, &XFS_RMAP_OINFO_INOBT, est_agfreeblocks, btr_fino);
- btr_fino->cur = libxfs_inobt_stage_cursor(pag,
- &btr_fino->newbt.afake, XFS_BTNUM_FINO);
+ btr_fino->cur = libxfs_inobt_init_cursor(pag, NULL, NULL,
+ XFS_BTNUM_FINO);
+ libxfs_btree_stage_afakeroot(btr_fino->cur, &btr_fino->newbt.afake);

btr_fino->bload.get_records = get_inobt_records;
btr_fino->bload.claim_block = rebuild_claim_block;