diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 01:55:13 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 01:55:13 -0400 |
commit | 8c4ed633e65d0bd0a25d45aad9b4646e3236cad7 (patch) | |
tree | 36877f1d34c0dbd20cfd0315112d62dbf4571b80 /fs/xfs/xfs_ialloc_btree.c | |
parent | 854929f05831d3a290a802815ee955b96c740c61 (diff) |
[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>
Diffstat (limited to 'fs/xfs/xfs_ialloc_btree.c')
-rw-r--r-- | fs/xfs/xfs_ialloc_btree.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ialloc_btree.c b/fs/xfs/xfs_ialloc_btree.c index 8c0c4748a8df..fc99524b17af 100644 --- a/fs/xfs/xfs_ialloc_btree.c +++ b/fs/xfs/xfs_ialloc_btree.c | |||
@@ -2085,8 +2085,81 @@ xfs_inobt_dup_cursor( | |||
2085 | cur->bc_private.a.agbp, cur->bc_private.a.agno); | 2085 | cur->bc_private.a.agbp, cur->bc_private.a.agno); |
2086 | } | 2086 | } |
2087 | 2087 | ||
2088 | #ifdef XFS_BTREE_TRACE | ||
2089 | ktrace_t *xfs_inobt_trace_buf; | ||
2090 | |||
2091 | STATIC void | ||
2092 | xfs_inobt_trace_enter( | ||
2093 | struct xfs_btree_cur *cur, | ||
2094 | const char *func, | ||
2095 | char *s, | ||
2096 | int type, | ||
2097 | int line, | ||
2098 | __psunsigned_t a0, | ||
2099 | __psunsigned_t a1, | ||
2100 | __psunsigned_t a2, | ||
2101 | __psunsigned_t a3, | ||
2102 | __psunsigned_t a4, | ||
2103 | __psunsigned_t a5, | ||
2104 | __psunsigned_t a6, | ||
2105 | __psunsigned_t a7, | ||
2106 | __psunsigned_t a8, | ||
2107 | __psunsigned_t a9, | ||
2108 | __psunsigned_t a10) | ||
2109 | { | ||
2110 | ktrace_enter(xfs_inobt_trace_buf, (void *)(__psint_t)type, | ||
2111 | (void *)func, (void *)s, NULL, (void *)cur, | ||
2112 | (void *)a0, (void *)a1, (void *)a2, (void *)a3, | ||
2113 | (void *)a4, (void *)a5, (void *)a6, (void *)a7, | ||
2114 | (void *)a8, (void *)a9, (void *)a10); | ||
2115 | } | ||
2116 | |||
2117 | STATIC void | ||
2118 | xfs_inobt_trace_cursor( | ||
2119 | struct xfs_btree_cur *cur, | ||
2120 | __uint32_t *s0, | ||
2121 | __uint64_t *l0, | ||
2122 | __uint64_t *l1) | ||
2123 | { | ||
2124 | *s0 = cur->bc_private.a.agno; | ||
2125 | *l0 = cur->bc_rec.i.ir_startino; | ||
2126 | *l1 = cur->bc_rec.i.ir_free; | ||
2127 | } | ||
2128 | |||
2129 | STATIC void | ||
2130 | xfs_inobt_trace_key( | ||
2131 | struct xfs_btree_cur *cur, | ||
2132 | union xfs_btree_key *key, | ||
2133 | __uint64_t *l0, | ||
2134 | __uint64_t *l1) | ||
2135 | { | ||
2136 | *l0 = be32_to_cpu(key->inobt.ir_startino); | ||
2137 | *l1 = 0; | ||
2138 | } | ||
2139 | |||
2140 | STATIC void | ||
2141 | xfs_inobt_trace_record( | ||
2142 | struct xfs_btree_cur *cur, | ||
2143 | union xfs_btree_rec *rec, | ||
2144 | __uint64_t *l0, | ||
2145 | __uint64_t *l1, | ||
2146 | __uint64_t *l2) | ||
2147 | { | ||
2148 | *l0 = be32_to_cpu(rec->inobt.ir_startino); | ||
2149 | *l1 = be32_to_cpu(rec->inobt.ir_freecount); | ||
2150 | *l2 = be64_to_cpu(rec->inobt.ir_free); | ||
2151 | } | ||
2152 | #endif /* XFS_BTREE_TRACE */ | ||
2153 | |||
2088 | static const struct xfs_btree_ops xfs_inobt_ops = { | 2154 | static const struct xfs_btree_ops xfs_inobt_ops = { |
2089 | .dup_cursor = xfs_inobt_dup_cursor, | 2155 | .dup_cursor = xfs_inobt_dup_cursor, |
2156 | |||
2157 | #ifdef XFS_BTREE_TRACE | ||
2158 | .trace_enter = xfs_inobt_trace_enter, | ||
2159 | .trace_cursor = xfs_inobt_trace_cursor, | ||
2160 | .trace_key = xfs_inobt_trace_key, | ||
2161 | .trace_record = xfs_inobt_trace_record, | ||
2162 | #endif | ||
2090 | }; | 2163 | }; |
2091 | 2164 | ||
2092 | /* | 2165 | /* |