]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: add a sick_mask to struct xfs_btree_ops
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Apr 2024 17:01:05 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:39 +0000 (11:37 -0700)
Source kernel commit: 7f47734ad61af77a001b1e24691dcbfcb008c938

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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_alloc_btree.c
libxfs/xfs_btree.h
libxfs/xfs_ialloc_btree.c
libxfs/xfs_refcount_btree.c
libxfs/xfs_rmap_btree.c

index d9e9ba53a7c488355fdc2b4ce1b9ad3ce3c8055d..6ad44c14614d712a4026e170797b4290e8936476 100644 (file)
@@ -17,6 +17,7 @@
 #include "xfs_trace.h"
 #include "xfs_trans.h"
 #include "xfs_ag.h"
+#include "xfs_health.h"
 
 static struct kmem_cache       *xfs_allocbt_cur_cache;
 
@@ -475,6 +476,7 @@ const struct xfs_btree_ops xfs_bnobt_ops = {
 
        .lru_refs               = XFS_ALLOC_BTREE_REF,
        .statoff                = XFS_STATS_CALC_INDEX(xs_abtb_2),
+       .sick_mask              = XFS_SICK_AG_BNOBT,
 
        .dup_cursor             = xfs_allocbt_dup_cursor,
        .set_root               = xfs_allocbt_set_root,
@@ -506,6 +508,7 @@ const struct xfs_btree_ops xfs_cntbt_ops = {
 
        .lru_refs               = XFS_ALLOC_BTREE_REF,
        .statoff                = XFS_STATS_CALC_INDEX(xs_abtc_2),
+       .sick_mask              = XFS_SICK_AG_CNTBT,
 
        .dup_cursor             = xfs_allocbt_dup_cursor,
        .set_root               = xfs_allocbt_set_root,
index 6bc6096205b3c8cc8bf892e0159315e1531a9323..6e5fd0c06453d3da34033b8b92343145d686770a 100644 (file)
@@ -142,6 +142,9 @@ struct xfs_btree_ops {
        /* offset of btree stats array */
        unsigned int            statoff;
 
+       /* sick mask for health reporting (only for XFS_BTREE_TYPE_AG) */
+       unsigned int            sick_mask;
+
        /* cursor operations */
        struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *);
        void    (*update_cursor)(struct xfs_btree_cur *src,
index 5e8a475631839d3c7282d3b268f2dbc004c5f21d..08076ef12bbfad9a214ad7aa153178fca9e62d49 100644 (file)
@@ -20,6 +20,7 @@
 #include "xfs_trans.h"
 #include "xfs_rmap.h"
 #include "xfs_ag.h"
+#include "xfs_health.h"
 
 static struct kmem_cache       *xfs_inobt_cur_cache;
 
@@ -407,6 +408,7 @@ const struct xfs_btree_ops xfs_inobt_ops = {
 
        .lru_refs               = XFS_INO_BTREE_REF,
        .statoff                = XFS_STATS_CALC_INDEX(xs_ibt_2),
+       .sick_mask              = XFS_SICK_AG_INOBT,
 
        .dup_cursor             = xfs_inobt_dup_cursor,
        .set_root               = xfs_inobt_set_root,
@@ -436,6 +438,7 @@ const struct xfs_btree_ops xfs_finobt_ops = {
 
        .lru_refs               = XFS_INO_BTREE_REF,
        .statoff                = XFS_STATS_CALC_INDEX(xs_fibt_2),
+       .sick_mask              = XFS_SICK_AG_FINOBT,
 
        .dup_cursor             = xfs_inobt_dup_cursor,
        .set_root               = xfs_finobt_set_root,
index 397ce2131933ba8ac02e06157b425dfff330f298..31ef879badb84ab7f38153e7b1562f9f9cb356f0 100644 (file)
@@ -20,6 +20,7 @@
 #include "xfs_bit.h"
 #include "xfs_rmap.h"
 #include "xfs_ag.h"
+#include "xfs_health.h"
 
 static struct kmem_cache       *xfs_refcountbt_cur_cache;
 
@@ -326,6 +327,7 @@ const struct xfs_btree_ops xfs_refcountbt_ops = {
 
        .lru_refs               = XFS_REFC_BTREE_REF,
        .statoff                = XFS_STATS_CALC_INDEX(xs_refcbt_2),
+       .sick_mask              = XFS_SICK_AG_REFCNTBT,
 
        .dup_cursor             = xfs_refcountbt_dup_cursor,
        .set_root               = xfs_refcountbt_set_root,
index 5bf5340c89835f01619d95975a5c992d0a759caf..c7ca2004354b14cc10a004f3b8650aa05c147a3e 100644 (file)
@@ -19,6 +19,7 @@
 #include "xfs_trace.h"
 #include "xfs_ag.h"
 #include "xfs_ag_resv.h"
+#include "xfs_health.h"
 
 static struct kmem_cache       *xfs_rmapbt_cur_cache;
 
@@ -481,6 +482,7 @@ const struct xfs_btree_ops xfs_rmapbt_ops = {
 
        .lru_refs               = XFS_RMAP_BTREE_REF,
        .statoff                = XFS_STATS_CALC_INDEX(xs_rmap_2),
+       .sick_mask              = XFS_SICK_AG_RMAPBT,
 
        .dup_cursor             = xfs_rmapbt_dup_cursor,
        .set_root               = xfs_rmapbt_set_root,