xfs: make full use of xfs_btree_stage_ifakeroot in xfs_bmbt_stage_cursor
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Feb 2024 20:39:43 +0000 (12:39 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:39:43 +0000 (12:39 -0800)
Remove the duplicate cur->bc_nlevels assignment in xfs_bmbt_stage_cursor,
and move the cur->bc_ino.forksize assignment into
xfs_btree_stage_ifakeroot as it is part of setting up the fake btree
root.

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>
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_btree_staging.c

index ec0b970157ae16c22d534a19cf595a359c9572d9..3b6f14196c8cd3345f95355e30ab54f6846e4ba9 100644 (file)
@@ -612,8 +612,6 @@ xfs_bmbt_stage_cursor(
 
        /* data fork always has larger maxheight */
        cur = xfs_bmbt_init_common(mp, NULL, ip, XFS_DATA_FORK);
-       cur->bc_nlevels = ifake->if_levels;
-       cur->bc_ino.forksize = ifake->if_fork_size;
 
        /* Don't let anyone think we're attached to the real fork yet. */
        cur->bc_ino.whichfork = -1;
index 185d6c3bbc024c279281469f709ec95645108054..d721719f759a8ad01a05b4e1b11e6c23ec2df1c1 100644 (file)
@@ -133,6 +133,7 @@ xfs_btree_stage_ifakeroot(
 
        cur->bc_ino.ifake = ifake;
        cur->bc_nlevels = ifake->if_levels;
+       cur->bc_ino.forksize = ifake->if_fork_size;
        cur->bc_flags |= XFS_BTREE_STAGING;
 }