xfs: fold xfs_bmbt_init_common into xfs_bmbt_init_cursor
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Feb 2024 20:39:44 +0000 (12:39 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:39:44 +0000 (12:39 -0800)
commit802f91f7b1d535ac975e2d696bf5b5dea82816e7
tree7685f1017c5f7af0d48074e17fea83e31fa136dc
parent42e357c806c8c0ffb9c5c2faa4ad034bfe950d77
xfs: fold xfs_bmbt_init_common into xfs_bmbt_init_cursor

Make the levels initialization in xfs_bmbt_init_cursor conditional
and merge the two helpers.

This requires the fakeroot case to now pass a -1 whichfork directly
into xfs_bmbt_init_cursor, and some special casing for that, but
at least this scheme to deal with the fake btree root is handled and
documented in once place now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[djwong: tidy up a multline ternary]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_bmap_btree.c