diff options
author | Christoph Hellwig <hch@lst.de> | 2024-02-22 21:39:47 +0100 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-02-22 21:39:47 +0100 |
commit | 7f47734ad61af77a001b1e24691dcbfcb008c938 (patch) | |
tree | 971552db96681a727f68a3025a27b858491e88fc /fs/xfs/xfs_health.c | |
parent | xfs: add a name field to struct xfs_btree_ops (diff) | |
download | linux-7f47734ad61af77a001b1e24691dcbfcb008c938.tar.xz linux-7f47734ad61af77a001b1e24691dcbfcb008c938.zip |
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 <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/xfs/xfs_health.c | 36 |
1 files changed, 11 insertions, 25 deletions
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); } /* |