mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
[XFS] make btree tracing generic
Make the existing bmap btree tracing generic so that it applies to all btree types. Some fragments lifted from a patch by Dave Chinner. SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32187a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Bill O'Donnell <billodo@sgi.com> Signed-off-by: David Chinner <david@fromorbit.com>
This commit is contained in:
parent
854929f058
commit
8c4ed633e6
10 changed files with 310 additions and 267 deletions
|
@ -2085,8 +2085,81 @@ xfs_inobt_dup_cursor(
|
|||
cur->bc_private.a.agbp, cur->bc_private.a.agno);
|
||||
}
|
||||
|
||||
#ifdef XFS_BTREE_TRACE
|
||||
ktrace_t *xfs_inobt_trace_buf;
|
||||
|
||||
STATIC void
|
||||
xfs_inobt_trace_enter(
|
||||
struct xfs_btree_cur *cur,
|
||||
const char *func,
|
||||
char *s,
|
||||
int type,
|
||||
int line,
|
||||
__psunsigned_t a0,
|
||||
__psunsigned_t a1,
|
||||
__psunsigned_t a2,
|
||||
__psunsigned_t a3,
|
||||
__psunsigned_t a4,
|
||||
__psunsigned_t a5,
|
||||
__psunsigned_t a6,
|
||||
__psunsigned_t a7,
|
||||
__psunsigned_t a8,
|
||||
__psunsigned_t a9,
|
||||
__psunsigned_t a10)
|
||||
{
|
||||
ktrace_enter(xfs_inobt_trace_buf, (void *)(__psint_t)type,
|
||||
(void *)func, (void *)s, NULL, (void *)cur,
|
||||
(void *)a0, (void *)a1, (void *)a2, (void *)a3,
|
||||
(void *)a4, (void *)a5, (void *)a6, (void *)a7,
|
||||
(void *)a8, (void *)a9, (void *)a10);
|
||||
}
|
||||
|
||||
STATIC void
|
||||
xfs_inobt_trace_cursor(
|
||||
struct xfs_btree_cur *cur,
|
||||
__uint32_t *s0,
|
||||
__uint64_t *l0,
|
||||
__uint64_t *l1)
|
||||
{
|
||||
*s0 = cur->bc_private.a.agno;
|
||||
*l0 = cur->bc_rec.i.ir_startino;
|
||||
*l1 = cur->bc_rec.i.ir_free;
|
||||
}
|
||||
|
||||
STATIC void
|
||||
xfs_inobt_trace_key(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_key *key,
|
||||
__uint64_t *l0,
|
||||
__uint64_t *l1)
|
||||
{
|
||||
*l0 = be32_to_cpu(key->inobt.ir_startino);
|
||||
*l1 = 0;
|
||||
}
|
||||
|
||||
STATIC void
|
||||
xfs_inobt_trace_record(
|
||||
struct xfs_btree_cur *cur,
|
||||
union xfs_btree_rec *rec,
|
||||
__uint64_t *l0,
|
||||
__uint64_t *l1,
|
||||
__uint64_t *l2)
|
||||
{
|
||||
*l0 = be32_to_cpu(rec->inobt.ir_startino);
|
||||
*l1 = be32_to_cpu(rec->inobt.ir_freecount);
|
||||
*l2 = be64_to_cpu(rec->inobt.ir_free);
|
||||
}
|
||||
#endif /* XFS_BTREE_TRACE */
|
||||
|
||||
static const struct xfs_btree_ops xfs_inobt_ops = {
|
||||
.dup_cursor = xfs_inobt_dup_cursor,
|
||||
|
||||
#ifdef XFS_BTREE_TRACE
|
||||
.trace_enter = xfs_inobt_trace_enter,
|
||||
.trace_cursor = xfs_inobt_trace_cursor,
|
||||
.trace_key = xfs_inobt_trace_key,
|
||||
.trace_record = xfs_inobt_trace_record,
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue