From 7f47734ad61af77a001b1e24691dcbfcb008c938 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 22 Feb 2024 12:39:47 -0800 Subject: xfs: add a sick_mask to struct xfs_btree_ops Clean up xfs_btree_mark_sick by adding a sick_mask to the btree-ops for all AG-root btrees. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_health.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) (limited to 'fs/xfs/xfs_health.c') diff --git a/fs/xfs/xfs_health.c b/fs/xfs/xfs_health.c index 855221c0dd34..9921b5d3f158 100644 --- a/fs/xfs/xfs_health.c +++ b/fs/xfs/xfs_health.c @@ -526,36 +526,22 @@ void xfs_btree_mark_sick( struct xfs_btree_cur *cur) { - unsigned int mask; - - switch (cur->bc_btnum) { - case XFS_BTNUM_BMAP: - xfs_bmap_mark_sick(cur->bc_ino.ip, cur->bc_ino.whichfork); + switch (cur->bc_ops->type) { + case XFS_BTREE_TYPE_AG: + ASSERT(cur->bc_ops->sick_mask); + xfs_ag_mark_sick(cur->bc_ag.pag, cur->bc_ops->sick_mask); return; - case XFS_BTNUM_BNO: - mask = XFS_SICK_AG_BNOBT; - break; - case XFS_BTNUM_CNT: - mask = XFS_SICK_AG_CNTBT; - break; - case XFS_BTNUM_INO: - mask = XFS_SICK_AG_INOBT; - break; - case XFS_BTNUM_FINO: - mask = XFS_SICK_AG_FINOBT; - break; - case XFS_BTNUM_RMAP: - mask = XFS_SICK_AG_RMAPBT; - break; - case XFS_BTNUM_REFC: - mask = XFS_SICK_AG_REFCNTBT; - break; + case XFS_BTREE_TYPE_INODE: + if (cur->bc_btnum == XFS_BTNUM_BMAP) { + xfs_bmap_mark_sick(cur->bc_ino.ip, + cur->bc_ino.whichfork); + return; + } + fallthrough; default: ASSERT(0); return; } - - xfs_ag_mark_sick(cur->bc_ag.pag, mask); } /* -- cgit v1.2.3-58-ga151