xfs: add a xfs_btree_init_ptr_from_cur
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Feb 2024 20:37:26 +0000 (12:37 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:37:26 +0000 (12:37 -0800)
commitf9c18129e57df7b33f4257340840525816481da6
treedf2ad3d71d37a7d303e36f58110d0fde80137787
parent72c2070f3f52196a2e8b4efced94390b62eb8ac4
xfs: add a xfs_btree_init_ptr_from_cur

Inode-rooted btrees don't need to initialize the root pointer in the
->init_ptr_from_cur method as the root is found by the
xfs_btree_get_iroot method later.  Make ->init_ptr_from_cur option
for inode rooted btrees by providing a helper that does the right
thing for the given btree type and also documents the semantics.

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.c
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_btree_staging.c
fs/xfs/scrub/btree.c