xfs: refactor the btree cursor allocation logic in xchk_ag_btcur_init
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Feb 2024 20:39:48 +0000 (12:39 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:39:48 +0000 (12:39 -0800)
commit48039926197522f32b548731a3b94331f0551bdc
treebdc0dada88407107606d76dc57bf8858f57522a8
parent7f47734ad61af77a001b1e24691dcbfcb008c938
xfs: refactor the btree cursor allocation logic in xchk_ag_btcur_init

Change xchk_ag_btcur_init to allocate all cursors first and only then
check if we should delete them again because the btree is to damaged.

This allows reusing the sick_mask in struct xfs_btree_ops and simplifies
the code.

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/scrub/common.c
fs/xfs/scrub/health.c
fs/xfs/scrub/health.h