@@ -8,7 +8,7 @@
#define trace_xfs_agfl_reset(a,b,c,d) ((void) 0)
#define trace_xfs_agfl_free_defer(a,b,c,d,e) ((void) 0)
-#define trace_xfs_alloc_cur_check(a,b,c,d,e,f) ((void) 0)
+#define trace_xfs_alloc_cur_check(...) ((void) 0)
#define trace_xfs_alloc_cur(a) ((void) 0)
#define trace_xfs_alloc_cur_left(a) ((void) 0)
#define trace_xfs_alloc_cur_lookup(a) ((void) 0)
@@ -269,9 +269,8 @@ xfs_alloc_complain_bad_rec(
struct xfs_mount *mp = cur->bc_mp;
xfs_warn(mp,
- "%s Freespace BTree record corruption in AG %d detected at %pS!",
- cur->bc_btnum == XFS_BTNUM_BNO ? "Block" : "Size",
- cur->bc_ag.pag->pag_agno, fa);
+ "%sbt record corruption in AG %d detected at %pS!",
+ cur->bc_ops->name, cur->bc_ag.pag->pag_agno, fa);
xfs_warn(mp,
"start block 0x%x block count 0x%x", irec->ar_startblock,
irec->ar_blockcount);
@@ -992,8 +991,7 @@ xfs_alloc_cur_check(
out:
if (deactivate)
cur->bc_flags &= ~XFS_BTREE_ALLOCBT_ACTIVE;
- trace_xfs_alloc_cur_check(args->mp, cur->bc_btnum, bno, len, diff,
- *new);
+ trace_xfs_alloc_cur_check(cur, bno, len, diff, *new);
return 0;
}
@@ -466,6 +466,7 @@ xfs_allocbt_keys_contiguous(
}
const struct xfs_btree_ops xfs_bnobt_ops = {
+ .name = "bno",
.type = XFS_BTREE_TYPE_AG,
.rec_len = sizeof(xfs_alloc_rec_t),
@@ -495,6 +496,7 @@ const struct xfs_btree_ops xfs_bnobt_ops = {
};
const struct xfs_btree_ops xfs_cntbt_ops = {
+ .name = "cnt",
.type = XFS_BTREE_TYPE_AG,
.geom_flags = XFS_BTGEO_LASTREC_UPDATE,
@@ -516,6 +516,7 @@ xfs_bmbt_keys_contiguous(
}
const struct xfs_btree_ops xfs_bmbt_ops = {
+ .name = "bmap",
.type = XFS_BTREE_TYPE_INODE,
.rec_len = sizeof(xfs_bmbt_rec_t),
@@ -295,17 +295,17 @@ xfs_btree_check_ptr(
level))
return 0;
xfs_err(cur->bc_mp,
-"Inode %llu fork %d: Corrupt btree %d pointer at level %d index %d.",
+"Inode %llu fork %d: Corrupt %sbt pointer at level %d index %d.",
cur->bc_ino.ip->i_ino,
- cur->bc_ino.whichfork, cur->bc_btnum,
+ cur->bc_ino.whichfork, cur->bc_ops->name,
level, index);
} else {
if (xfs_btree_check_sptr(cur, be32_to_cpu((&ptr->s)[index]),
level))
return 0;
xfs_err(cur->bc_mp,
-"AG %u: Corrupt btree %d pointer at level %d index %d.",
- cur->bc_ag.pag->pag_agno, cur->bc_btnum,
+"AG %u: Corrupt %sbt pointer at level %d index %d.",
+ cur->bc_ag.pag->pag_agno, cur->bc_ops->name,
level, index);
}
@@ -123,6 +123,8 @@ enum xfs_btree_type {
};
struct xfs_btree_ops {
+ const char *name;
+
/* Type of btree - AG-rooted or inode-rooted */
enum xfs_btree_type type;
@@ -136,9 +136,8 @@ xfs_inobt_complain_bad_rec(
struct xfs_mount *mp = cur->bc_mp;
xfs_warn(mp,
- "%s Inode BTree record corruption in AG %d detected at %pS!",
- cur->bc_btnum == XFS_BTNUM_INO ? "Used" : "Free",
- cur->bc_ag.pag->pag_agno, fa);
+ "%sbt record corruption in AG %d detected at %pS!",
+ cur->bc_ops->name, cur->bc_ag.pag->pag_agno, fa);
xfs_warn(mp,
"start inode 0x%x, count 0x%x, free 0x%x freemask 0x%llx, holemask 0x%x",
irec->ir_startino, irec->ir_count, irec->ir_freecount,
@@ -398,6 +398,7 @@ xfs_inobt_keys_contiguous(
}
const struct xfs_btree_ops xfs_inobt_ops = {
+ .name = "ino",
.type = XFS_BTREE_TYPE_AG,
.rec_len = sizeof(xfs_inobt_rec_t),
@@ -426,6 +427,7 @@ const struct xfs_btree_ops xfs_inobt_ops = {
};
const struct xfs_btree_ops xfs_finobt_ops = {
+ .name = "fino",
.type = XFS_BTREE_TYPE_AG,
.rec_len = sizeof(xfs_inobt_rec_t),
@@ -317,6 +317,7 @@ xfs_refcountbt_keys_contiguous(
}
const struct xfs_btree_ops xfs_refcountbt_ops = {
+ .name = "refcount",
.type = XFS_BTREE_TYPE_AG,
.rec_len = sizeof(struct xfs_refcount_rec),
@@ -470,6 +470,7 @@ xfs_rmapbt_keys_contiguous(
}
const struct xfs_btree_ops xfs_rmapbt_ops = {
+ .name = "rmap",
.type = XFS_BTREE_TYPE_AG,
.geom_flags = XFS_BTGEO_OVERLAPPING,
@@ -125,15 +125,6 @@ typedef enum {
XFS_BTNUM_INOi, XFS_BTNUM_FINOi, XFS_BTNUM_REFCi, XFS_BTNUM_MAX
} xfs_btnum_t;
-#define XFS_BTNUM_STRINGS \
- { XFS_BTNUM_BNOi, "bnobt" }, \
- { XFS_BTNUM_CNTi, "cntbt" }, \
- { XFS_BTNUM_RMAPi, "rmapbt" }, \
- { XFS_BTNUM_BMAPi, "bmbt" }, \
- { XFS_BTNUM_INOi, "inobt" }, \
- { XFS_BTNUM_FINOi, "finobt" }, \
- { XFS_BTNUM_REFCi, "refcbt" }
-
struct xfs_name {
const unsigned char *name;
int len;