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_alloc_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_alloc_btree.c')
-rw-r--r-- | fs/xfs/xfs_alloc_btree.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c index 60c121f1e81b..9c91dfcb6f29 100644 --- a/fs/xfs/xfs_alloc_btree.c +++ b/fs/xfs/xfs_alloc_btree.c | |||
@@ -2219,8 +2219,81 @@ xfs_allocbt_dup_cursor( | |||
2219 | cur->bc_btnum); | 2219 | cur->bc_btnum); |
2220 | } | 2220 | } |
2221 | 2221 | ||
2222 | #ifdef XFS_BTREE_TRACE | ||
2223 | ktrace_t *xfs_allocbt_trace_buf; | ||
2224 | |||
2225 | STATIC void | ||
2226 | xfs_allocbt_trace_enter( | ||
2227 | struct xfs_btree_cur *cur, | ||
2228 | const char *func, | ||
2229 | char *s, | ||
2230 | int type, | ||
2231 | int line, | ||
2232 | __psunsigned_t a0, | ||
2233 | __psunsigned_t a1, | ||
2234 | __psunsigned_t a2, | ||
2235 | __psunsigned_t a3, | ||
2236 | __psunsigned_t a4, | ||
2237 | __psunsigned_t a5, | ||
2238 | __psunsigned_t a6, | ||
2239 | __psunsigned_t a7, | ||
2240 | __psunsigned_t a8, | ||
2241 | __psunsigned_t a9, | ||
2242 | __psunsigned_t a10) | ||
2243 | { | ||
2244 | ktrace_enter(xfs_allocbt_trace_buf, (void *)(__psint_t)type, | ||
2245 | (void *)func, (void *)s, NULL, (void *)cur, | ||
2246 | (void *)a0, (void *)a1, (void *)a2, (void *)a3, | ||
2247 | (void *)a4, (void *)a5, (void *)a6, (void *)a7, | ||
2248 | (void *)a8, (void *)a9, (void *)a10); | ||
2249 | } | ||
2250 | |||
2251 | STATIC void | ||
2252 | xfs_allocbt_trace_cursor( | ||
2253 | struct xfs_btree_cur *cur, | ||
2254 | __uint32_t *s0, | ||
2255 | __uint64_t *l0, | ||
2256 | __uint64_t *l1) | ||
2257 | { | ||
2258 | *s0 = cur->bc_private.a.agno; | ||
2259 | *l0 = cur->bc_rec.a.ar_startblock; | ||
2260 | *l1 = cur->bc_rec.a.ar_blockcount; | ||
2261 | } | ||
2262 | |||
2263 | STATIC void | ||
2264 | xfs_allocbt_trace_key( | ||
2265 | struct xfs_btree_cur *cur, | ||
2266 | union xfs_btree_key *key, | ||
2267 | __uint64_t *l0, | ||
2268 | __uint64_t *l1) | ||
2269 | { | ||
2270 | *l0 = be32_to_cpu(key->alloc.ar_startblock); | ||
2271 | *l1 = be32_to_cpu(key->alloc.ar_blockcount); | ||
2272 | } | ||
2273 | |||
2274 | STATIC void | ||
2275 | xfs_allocbt_trace_record( | ||
2276 | struct xfs_btree_cur *cur, | ||
2277 | union xfs_btree_rec *rec, | ||
2278 | __uint64_t *l0, | ||
2279 | __uint64_t *l1, | ||
2280 | __uint64_t *l2) | ||
2281 | { | ||
2282 | *l0 = be32_to_cpu(rec->alloc.ar_startblock); | ||
2283 | *l1 = be32_to_cpu(rec->alloc.ar_blockcount); | ||
2284 | *l2 = 0; | ||
2285 | } | ||
2286 | #endif /* XFS_BTREE_TRACE */ | ||
2287 | |||
2222 | static const struct xfs_btree_ops xfs_allocbt_ops = { | 2288 | static const struct xfs_btree_ops xfs_allocbt_ops = { |
2223 | .dup_cursor = xfs_allocbt_dup_cursor, | 2289 | .dup_cursor = xfs_allocbt_dup_cursor, |
2290 | |||
2291 | #ifdef XFS_BTREE_TRACE | ||
2292 | .trace_enter = xfs_allocbt_trace_enter, | ||
2293 | .trace_cursor = xfs_allocbt_trace_cursor, | ||
2294 | .trace_key = xfs_allocbt_trace_key, | ||
2295 | .trace_record = xfs_allocbt_trace_record, | ||
2296 | #endif | ||
2224 | }; | 2297 | }; |
2225 | 2298 | ||
2226 | /* | 2299 | /* |