]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove xfs_bmbt_stage_cursor
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Apr 2024 17:01:04 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:39 +0000 (11:37 -0700)
Source kernel commit: 02f7ebf5f99c3776bbf048786885eeafeb2f21ca

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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
db/bmap_inflate.c
libxfs/libxfs_api_defs.h
libxfs/xfs_bmap_btree.c
libxfs/xfs_bmap_btree.h
repair/bmap_repair.c

index 33b0c954d8f88ac14b3b320ddeb0b806361e22a8..c85d5dc0d64a233f089e291e4cc8f64dd78103f5 100644 (file)
@@ -351,7 +351,9 @@ build_new_datafork(
        /* Set up staging for the new bmbt */
        ifake.if_fork = kmem_cache_zalloc(xfs_ifork_cache, 0);
        ifake.if_fork_size = xfs_inode_fork_size(ip, XFS_DATA_FORK);
-       bmap_cur = libxfs_bmbt_stage_cursor(ip->i_mount, ip, &ifake);
+       bmap_cur = libxfs_bmbt_init_cursor(ip->i_mount, NULL, ip,
+                       XFS_STAGING_FORK);
+       libxfs_btree_stage_ifakeroot(bmap_cur, &ifake);
 
        /*
         * Figure out the size and format of the new fork, then fill it with
@@ -405,7 +407,9 @@ estimate_size(
        ifake.if_fork = kmem_cache_zalloc(xfs_ifork_cache, 0);
        ifake.if_fork_size = xfs_inode_fork_size(ip, XFS_DATA_FORK);
 
-       bmap_cur = libxfs_bmbt_stage_cursor(ip->i_mount, ip, &ifake);
+       bmap_cur = libxfs_bmbt_init_cursor(ip->i_mount, NULL, ip,
+                       XFS_STAGING_FORK);
+       libxfs_btree_stage_ifakeroot(bmap_cur, &ifake);
        error = -libxfs_btree_bload_compute_geometry(bmap_cur, &bmap_bload,
                        nextents);
        libxfs_btree_del_cursor(bmap_cur, error);
index 2adf20ce8a4136f9be0c453375f1221ac199ee14..b0f9d9edb634c5b4d32a14f281ce78f3dc65dfe9 100644 (file)
@@ -54,6 +54,7 @@
 #define xfs_bmbt_commit_staged_btree   libxfs_bmbt_commit_staged_btree
 #define xfs_bmbt_disk_get_startoff     libxfs_bmbt_disk_get_startoff
 #define xfs_bmbt_disk_set_all          libxfs_bmbt_disk_set_all
+#define xfs_bmbt_init_cursor           libxfs_bmbt_init_cursor
 #define xfs_bmbt_maxlevels_ondisk      libxfs_bmbt_maxlevels_ondisk
 #define xfs_bmbt_maxrecs               libxfs_bmbt_maxrecs
 #define xfs_bmbt_stage_cursor          libxfs_bmbt_stage_cursor
@@ -65,6 +66,7 @@
 #define xfs_btree_init_block           libxfs_btree_init_block
 #define xfs_btree_rec_addr             libxfs_btree_rec_addr
 #define xfs_btree_stage_afakeroot      libxfs_btree_stage_afakeroot
+#define xfs_btree_stage_ifakeroot      libxfs_btree_stage_ifakeroot
 #define xfs_buf_delwri_submit          libxfs_buf_delwri_submit
 #define xfs_buf_get                    libxfs_buf_get
 #define xfs_buf_get_uncached           libxfs_buf_get_uncached
index 0afe541c52cde1bbfd42db6408d893e84f360ac5..828dfb7d4247e1f4f520d5363f377bb91b358daf 100644 (file)
@@ -597,25 +597,6 @@ xfs_bmbt_block_maxrecs(
        return blocklen / (sizeof(xfs_bmbt_key_t) + sizeof(xfs_bmbt_ptr_t));
 }
 
-/*
- * Allocate a new bmap btree cursor for reloading an inode block mapping data
- * structure.  Note that callers can use the staged cursor to reload extents
- * format inode forks if they rebuild the iext tree and commit the staged
- * cursor immediately.
- */
-struct xfs_btree_cur *
-xfs_bmbt_stage_cursor(
-       struct xfs_mount        *mp,
-       struct xfs_inode        *ip,
-       struct xbtree_ifakeroot *ifake)
-{
-       struct xfs_btree_cur    *cur;
-
-       cur = xfs_bmbt_init_cursor(mp, NULL, ip, XFS_STAGING_FORK);
-       xfs_btree_stage_ifakeroot(cur, ifake);
-       return cur;
-}
-
 /*
  * Swap in the new inode fork root.  Once we pass this point the newly rebuilt
  * mappings are in place and we have to kill off any old btree blocks.
index e93aa42e2bf5b8921ff1d0b8f7e4fca4ccea4ac9..de1b73f1225ca7df1d821f78eab3b29f57167453 100644 (file)
@@ -107,8 +107,6 @@ extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip,
 
 extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *,
                struct xfs_trans *, struct xfs_inode *, int);
-struct xfs_btree_cur *xfs_bmbt_stage_cursor(struct xfs_mount *mp,
-               struct xfs_inode *ip, struct xbtree_ifakeroot *ifake);
 void xfs_bmbt_commit_staged_btree(struct xfs_btree_cur *cur,
                struct xfs_trans *tp, int whichfork);
 
index 1dbcafb22736c55a81f382da8338e0e8d6720fa6..845584f18450716a735a0720224f47bb4e91f560 100644 (file)
@@ -475,7 +475,9 @@ xrep_bmap_build_new_fork(
         */
        libxfs_rmap_ino_bmbt_owner(&oinfo, sc->ip->i_ino, rb->whichfork);
        bulkload_init_inode(&rb->new_fork_info, sc, rb->whichfork, &oinfo);
-       bmap_cur = libxfs_bmbt_stage_cursor(sc->mp, sc->ip, ifake);
+       bmap_cur = libxfs_bmbt_init_cursor(sc->mp, NULL, sc->ip,
+                       XFS_STAGING_FORK);
+       libxfs_btree_stage_ifakeroot(bmap_cur, ifake);
 
        /*
         * Figure out the size and format of the new fork, then fill it with