diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-28 21:46:47 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 21:39:25 -0400 |
commit | 1543d79c45a374f934f95ca34d87e2eeeb2039b4 (patch) | |
tree | abe537e7c241f2a764687c54d805ebfdb5147e3c /fs/xfs | |
parent | b677c210cec0d6755335ffc01691982c417dd39e (diff) |
[XFS] move v_trace from bhv_vnode to xfs_inode
struct bhv_vnode is on it's way out, so move the trace buffer to the XFS
inode. Note that this makes the tracing macros rather misnamed, but this
kind of fallout will be fixed up incrementally later on.
SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29498a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 40 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.c | 46 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 21 | ||||
-rw-r--r-- | fs/xfs/xfs_dir2.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_iget.c | 10 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.h | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_rename.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_utils.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_utils.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 42 |
13 files changed, 94 insertions, 89 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 1dd198ec289..f766c7f74dc 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -1526,7 +1526,7 @@ xfs_vm_bmap( | |||
1526 | struct inode *inode = (struct inode *)mapping->host; | 1526 | struct inode *inode = (struct inode *)mapping->host; |
1527 | struct xfs_inode *ip = XFS_I(inode); | 1527 | struct xfs_inode *ip = XFS_I(inode); |
1528 | 1528 | ||
1529 | vn_trace_entry(vn_from_inode(inode), __FUNCTION__, | 1529 | vn_trace_entry(XFS_I(inode), __FUNCTION__, |
1530 | (inst_t *)__return_address); | 1530 | (inst_t *)__return_address); |
1531 | xfs_rwlock(ip, VRWLOCK_READ); | 1531 | xfs_rwlock(ip, VRWLOCK_READ); |
1532 | xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); | 1532 | xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 8ff465db909..4c38e27ed18 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -733,7 +733,7 @@ xfs_ioctl( | |||
733 | xfs_mount_t *mp = ip->i_mount; | 733 | xfs_mount_t *mp = ip->i_mount; |
734 | int error; | 734 | int error; |
735 | 735 | ||
736 | vn_trace_entry(vp, "xfs_ioctl", (inst_t *)__return_address); | 736 | vn_trace_entry(XFS_I(inode), "xfs_ioctl", (inst_t *)__return_address); |
737 | 737 | ||
738 | switch (cmd) { | 738 | switch (cmd) { |
739 | 739 | ||
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 47bca4e4696..bb0c4a932fd 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -403,7 +403,7 @@ xfs_fs_write_inode( | |||
403 | { | 403 | { |
404 | int error = 0, flags = FLUSH_INODE; | 404 | int error = 0, flags = FLUSH_INODE; |
405 | 405 | ||
406 | vn_trace_entry(vn_from_inode(inode), __FUNCTION__, | 406 | vn_trace_entry(XFS_I(inode), __FUNCTION__, |
407 | (inst_t *)__return_address); | 407 | (inst_t *)__return_address); |
408 | if (sync) { | 408 | if (sync) { |
409 | filemap_fdatawait(inode->i_mapping); | 409 | filemap_fdatawait(inode->i_mapping); |
@@ -425,34 +425,27 @@ STATIC void | |||
425 | xfs_fs_clear_inode( | 425 | xfs_fs_clear_inode( |
426 | struct inode *inode) | 426 | struct inode *inode) |
427 | { | 427 | { |
428 | bhv_vnode_t *vp = vn_from_inode(inode); | 428 | xfs_inode_t *ip = XFS_I(inode); |
429 | |||
430 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | ||
431 | |||
432 | XFS_STATS_INC(vn_rele); | ||
433 | XFS_STATS_INC(vn_remove); | ||
434 | XFS_STATS_INC(vn_reclaim); | ||
435 | XFS_STATS_DEC(vn_active); | ||
436 | 429 | ||
437 | /* | 430 | /* |
438 | * This can happen because xfs_iget_core calls xfs_idestroy if we | 431 | * ip can be null when xfs_iget_core calls xfs_idestroy if we |
439 | * find an inode with di_mode == 0 but without IGET_CREATE set. | 432 | * find an inode with di_mode == 0 but without IGET_CREATE set. |
440 | */ | 433 | */ |
441 | if (XFS_I(inode)) | 434 | if (ip) { |
442 | xfs_inactive(XFS_I(inode)); | 435 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
443 | 436 | ||
444 | 437 | XFS_STATS_INC(vn_rele); | |
445 | if (XFS_I(inode)) { | 438 | XFS_STATS_INC(vn_remove); |
446 | xfs_iflags_clear(XFS_I(inode), XFS_IMODIFIED); | 439 | XFS_STATS_INC(vn_reclaim); |
447 | if (xfs_reclaim(XFS_I(inode))) | 440 | XFS_STATS_DEC(vn_active); |
448 | panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp); | 441 | |
442 | xfs_inactive(ip); | ||
443 | xfs_iflags_clear(ip, XFS_IMODIFIED); | ||
444 | if (xfs_reclaim(ip)) | ||
445 | panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, inode); | ||
449 | } | 446 | } |
450 | 447 | ||
451 | ASSERT(XFS_I(inode) == NULL); | 448 | ASSERT(XFS_I(inode) == NULL); |
452 | |||
453 | #ifdef XFS_VNODE_TRACE | ||
454 | ktrace_free(vp->v_trace); | ||
455 | #endif | ||
456 | } | 449 | } |
457 | 450 | ||
458 | /* | 451 | /* |
@@ -840,7 +833,8 @@ xfs_fs_fill_super( | |||
840 | } | 833 | } |
841 | if ((error = xfs_fs_start_syncd(vfsp))) | 834 | if ((error = xfs_fs_start_syncd(vfsp))) |
842 | goto fail_vnrele; | 835 | goto fail_vnrele; |
843 | vn_trace_exit(rootvp, __FUNCTION__, (inst_t *)__return_address); | 836 | vn_trace_exit(XFS_I(sb->s_root->d_inode), __FUNCTION__, |
837 | (inst_t *)__return_address); | ||
844 | 838 | ||
845 | kmem_free(args, sizeof(*args)); | 839 | kmem_free(args, sizeof(*args)); |
846 | return 0; | 840 | return 0; |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index bde8d2e7f55..9d9464cf8de 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c | |||
@@ -103,11 +103,6 @@ vn_initialize( | |||
103 | 103 | ||
104 | ASSERT(VN_CACHED(vp) == 0); | 104 | ASSERT(VN_CACHED(vp) == 0); |
105 | 105 | ||
106 | #ifdef XFS_VNODE_TRACE | ||
107 | vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); | ||
108 | #endif /* XFS_VNODE_TRACE */ | ||
109 | |||
110 | vn_trace_exit(vp, __FUNCTION__, (inst_t *)__return_address); | ||
111 | return vp; | 106 | return vp; |
112 | } | 107 | } |
113 | 108 | ||
@@ -158,7 +153,7 @@ __vn_revalidate( | |||
158 | { | 153 | { |
159 | int error; | 154 | int error; |
160 | 155 | ||
161 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 156 | vn_trace_entry(xfs_vtoi(vp), __FUNCTION__, (inst_t *)__return_address); |
162 | vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; | 157 | vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; |
163 | error = xfs_getattr(xfs_vtoi(vp), vattr, 0); | 158 | error = xfs_getattr(xfs_vtoi(vp), vattr, 0); |
164 | if (likely(!error)) { | 159 | if (likely(!error)) { |
@@ -196,12 +191,25 @@ vn_hold( | |||
196 | 191 | ||
197 | #ifdef XFS_VNODE_TRACE | 192 | #ifdef XFS_VNODE_TRACE |
198 | 193 | ||
199 | #define KTRACE_ENTER(vp, vk, s, line, ra) \ | 194 | /* |
200 | ktrace_enter( (vp)->v_trace, \ | 195 | * Reference count of Linux inode if present, -1 if the xfs_inode |
196 | * has no associated Linux inode. | ||
197 | */ | ||
198 | static inline int xfs_icount(struct xfs_inode *ip) | ||
199 | { | ||
200 | bhv_vnode_t *vp = XFS_ITOV_NULL(ip); | ||
201 | |||
202 | if (vp) | ||
203 | return vn_count(vp); | ||
204 | return -1; | ||
205 | } | ||
206 | |||
207 | #define KTRACE_ENTER(ip, vk, s, line, ra) \ | ||
208 | ktrace_enter( (ip)->i_trace, \ | ||
201 | /* 0 */ (void *)(__psint_t)(vk), \ | 209 | /* 0 */ (void *)(__psint_t)(vk), \ |
202 | /* 1 */ (void *)(s), \ | 210 | /* 1 */ (void *)(s), \ |
203 | /* 2 */ (void *)(__psint_t) line, \ | 211 | /* 2 */ (void *)(__psint_t) line, \ |
204 | /* 3 */ (void *)(__psint_t)(vn_count(vp)), \ | 212 | /* 3 */ (void *)(__psint_t)xfs_icount(ip), \ |
205 | /* 4 */ (void *)(ra), \ | 213 | /* 4 */ (void *)(ra), \ |
206 | /* 5 */ NULL, \ | 214 | /* 5 */ NULL, \ |
207 | /* 6 */ (void *)(__psint_t)current_cpu(), \ | 215 | /* 6 */ (void *)(__psint_t)current_cpu(), \ |
@@ -213,32 +221,32 @@ vn_hold( | |||
213 | * Vnode tracing code. | 221 | * Vnode tracing code. |
214 | */ | 222 | */ |
215 | void | 223 | void |
216 | vn_trace_entry(bhv_vnode_t *vp, const char *func, inst_t *ra) | 224 | vn_trace_entry(xfs_inode_t *ip, const char *func, inst_t *ra) |
217 | { | 225 | { |
218 | KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra); | 226 | KTRACE_ENTER(ip, VNODE_KTRACE_ENTRY, func, 0, ra); |
219 | } | 227 | } |
220 | 228 | ||
221 | void | 229 | void |
222 | vn_trace_exit(bhv_vnode_t *vp, const char *func, inst_t *ra) | 230 | vn_trace_exit(xfs_inode_t *ip, const char *func, inst_t *ra) |
223 | { | 231 | { |
224 | KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra); | 232 | KTRACE_ENTER(ip, VNODE_KTRACE_EXIT, func, 0, ra); |
225 | } | 233 | } |
226 | 234 | ||
227 | void | 235 | void |
228 | vn_trace_hold(bhv_vnode_t *vp, char *file, int line, inst_t *ra) | 236 | vn_trace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra) |
229 | { | 237 | { |
230 | KTRACE_ENTER(vp, VNODE_KTRACE_HOLD, file, line, ra); | 238 | KTRACE_ENTER(ip, VNODE_KTRACE_HOLD, file, line, ra); |
231 | } | 239 | } |
232 | 240 | ||
233 | void | 241 | void |
234 | vn_trace_ref(bhv_vnode_t *vp, char *file, int line, inst_t *ra) | 242 | vn_trace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra) |
235 | { | 243 | { |
236 | KTRACE_ENTER(vp, VNODE_KTRACE_REF, file, line, ra); | 244 | KTRACE_ENTER(ip, VNODE_KTRACE_REF, file, line, ra); |
237 | } | 245 | } |
238 | 246 | ||
239 | void | 247 | void |
240 | vn_trace_rele(bhv_vnode_t *vp, char *file, int line, inst_t *ra) | 248 | vn_trace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra) |
241 | { | 249 | { |
242 | KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra); | 250 | KTRACE_ENTER(ip, VNODE_KTRACE_RELE, file, line, ra); |
243 | } | 251 | } |
244 | #endif /* XFS_VNODE_TRACE */ | 252 | #endif /* XFS_VNODE_TRACE */ |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 321346d9526..2b161361c1a 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -29,9 +29,6 @@ typedef __u64 bhv_vnumber_t; | |||
29 | 29 | ||
30 | typedef struct bhv_vnode { | 30 | typedef struct bhv_vnode { |
31 | bhv_vnumber_t v_number; /* in-core vnode number */ | 31 | bhv_vnumber_t v_number; /* in-core vnode number */ |
32 | #ifdef XFS_VNODE_TRACE | ||
33 | struct ktrace *v_trace; /* trace header structure */ | ||
34 | #endif | ||
35 | struct inode v_inode; /* Linux inode */ | 32 | struct inode v_inode; /* Linux inode */ |
36 | /* inode MUST be last */ | 33 | /* inode MUST be last */ |
37 | } bhv_vnode_t; | 34 | } bhv_vnode_t; |
@@ -222,9 +219,9 @@ extern bhv_vnode_t *vn_hold(struct bhv_vnode *); | |||
222 | #if defined(XFS_VNODE_TRACE) | 219 | #if defined(XFS_VNODE_TRACE) |
223 | #define VN_HOLD(vp) \ | 220 | #define VN_HOLD(vp) \ |
224 | ((void)vn_hold(vp), \ | 221 | ((void)vn_hold(vp), \ |
225 | vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) | 222 | vn_trace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address)) |
226 | #define VN_RELE(vp) \ | 223 | #define VN_RELE(vp) \ |
227 | (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ | 224 | (vn_trace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ |
228 | iput(vn_to_inode(vp))) | 225 | iput(vn_to_inode(vp))) |
229 | #else | 226 | #else |
230 | #define VN_HOLD(vp) ((void)vn_hold(vp)) | 227 | #define VN_HOLD(vp) ((void)vn_hold(vp)) |
@@ -314,21 +311,17 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt) | |||
314 | #define VNODE_KTRACE_REF 4 | 311 | #define VNODE_KTRACE_REF 4 |
315 | #define VNODE_KTRACE_RELE 5 | 312 | #define VNODE_KTRACE_RELE 5 |
316 | 313 | ||
317 | extern void vn_trace_entry(struct bhv_vnode *, const char *, inst_t *); | 314 | extern void vn_trace_entry(struct xfs_inode *, const char *, inst_t *); |
318 | extern void vn_trace_exit(struct bhv_vnode *, const char *, inst_t *); | 315 | extern void vn_trace_exit(struct xfs_inode *, const char *, inst_t *); |
319 | extern void vn_trace_hold(struct bhv_vnode *, char *, int, inst_t *); | 316 | extern void vn_trace_hold(struct xfs_inode *, char *, int, inst_t *); |
320 | extern void vn_trace_ref(struct bhv_vnode *, char *, int, inst_t *); | 317 | extern void vn_trace_ref(struct xfs_inode *, char *, int, inst_t *); |
321 | extern void vn_trace_rele(struct bhv_vnode *, char *, int, inst_t *); | 318 | extern void vn_trace_rele(struct xfs_inode *, char *, int, inst_t *); |
322 | |||
323 | #define VN_TRACE(vp) \ | ||
324 | vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address) | ||
325 | #else | 319 | #else |
326 | #define vn_trace_entry(a,b,c) | 320 | #define vn_trace_entry(a,b,c) |
327 | #define vn_trace_exit(a,b,c) | 321 | #define vn_trace_exit(a,b,c) |
328 | #define vn_trace_hold(a,b,c,d) | 322 | #define vn_trace_hold(a,b,c,d) |
329 | #define vn_trace_ref(a,b,c,d) | 323 | #define vn_trace_ref(a,b,c,d) |
330 | #define vn_trace_rele(a,b,c,d) | 324 | #define vn_trace_rele(a,b,c,d) |
331 | #define VN_TRACE(vp) | ||
332 | #endif | 325 | #endif |
333 | 326 | ||
334 | #endif /* __XFS_VNODE_H__ */ | 327 | #endif /* __XFS_VNODE_H__ */ |
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index 12001bf0d0c..b0f1ee8fcb9 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c | |||
@@ -301,7 +301,7 @@ xfs_readdir( | |||
301 | int rval; /* return value */ | 301 | int rval; /* return value */ |
302 | int v; /* type-checking value */ | 302 | int v; /* type-checking value */ |
303 | 303 | ||
304 | vn_trace_entry(XFS_ITOV(dp), __FUNCTION__, (inst_t *)__return_address); | 304 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
305 | 305 | ||
306 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) | 306 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) |
307 | return XFS_ERROR(EIO); | 307 | return XFS_ERROR(EIO); |
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index ee13d6d708c..001cec705e2 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c | |||
@@ -157,7 +157,7 @@ again: | |||
157 | goto again; | 157 | goto again; |
158 | } | 158 | } |
159 | 159 | ||
160 | vn_trace_exit(vp, "xfs_iget.alloc", | 160 | vn_trace_exit(ip, "xfs_iget.alloc", |
161 | (inst_t *)__return_address); | 161 | (inst_t *)__return_address); |
162 | 162 | ||
163 | XFS_STATS_INC(xs_ig_found); | 163 | XFS_STATS_INC(xs_ig_found); |
@@ -212,7 +212,7 @@ finish_inode: | |||
212 | xfs_ilock(ip, lock_flags); | 212 | xfs_ilock(ip, lock_flags); |
213 | 213 | ||
214 | xfs_iflags_clear(ip, XFS_ISTALE); | 214 | xfs_iflags_clear(ip, XFS_ISTALE); |
215 | vn_trace_exit(vp, "xfs_iget.found", | 215 | vn_trace_exit(ip, "xfs_iget.found", |
216 | (inst_t *)__return_address); | 216 | (inst_t *)__return_address); |
217 | goto return_ip; | 217 | goto return_ip; |
218 | } | 218 | } |
@@ -234,7 +234,7 @@ finish_inode: | |||
234 | return error; | 234 | return error; |
235 | } | 235 | } |
236 | 236 | ||
237 | vn_trace_exit(vp, "xfs_iget.alloc", (inst_t *)__return_address); | 237 | vn_trace_exit(ip, "xfs_iget.alloc", (inst_t *)__return_address); |
238 | 238 | ||
239 | xfs_inode_lock_init(ip, vp); | 239 | xfs_inode_lock_init(ip, vp); |
240 | xfs_iocore_inode_init(ip); | 240 | xfs_iocore_inode_init(ip); |
@@ -467,7 +467,7 @@ xfs_iput(xfs_inode_t *ip, | |||
467 | { | 467 | { |
468 | bhv_vnode_t *vp = XFS_ITOV(ip); | 468 | bhv_vnode_t *vp = XFS_ITOV(ip); |
469 | 469 | ||
470 | vn_trace_entry(vp, "xfs_iput", (inst_t *)__return_address); | 470 | vn_trace_entry(ip, "xfs_iput", (inst_t *)__return_address); |
471 | xfs_iunlock(ip, lock_flags); | 471 | xfs_iunlock(ip, lock_flags); |
472 | VN_RELE(vp); | 472 | VN_RELE(vp); |
473 | } | 473 | } |
@@ -482,7 +482,7 @@ xfs_iput_new(xfs_inode_t *ip, | |||
482 | bhv_vnode_t *vp = XFS_ITOV(ip); | 482 | bhv_vnode_t *vp = XFS_ITOV(ip); |
483 | struct inode *inode = vn_to_inode(vp); | 483 | struct inode *inode = vn_to_inode(vp); |
484 | 484 | ||
485 | vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address); | 485 | vn_trace_entry(ip, "xfs_iput_new", (inst_t *)__return_address); |
486 | 486 | ||
487 | if ((ip->i_d.di_mode == 0)) { | 487 | if ((ip->i_d.di_mode == 0)) { |
488 | ASSERT(!xfs_iflags_test(ip, XFS_IRECLAIMABLE)); | 488 | ASSERT(!xfs_iflags_test(ip, XFS_IRECLAIMABLE)); |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 0349e714dc3..b82f4e43ef3 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -884,6 +884,9 @@ xfs_iread( | |||
884 | * Initialize inode's trace buffers. | 884 | * Initialize inode's trace buffers. |
885 | * Do this before xfs_iformat in case it adds entries. | 885 | * Do this before xfs_iformat in case it adds entries. |
886 | */ | 886 | */ |
887 | #ifdef XFS_VNODE_TRACE | ||
888 | ip->i_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); | ||
889 | #endif | ||
887 | #ifdef XFS_BMAP_TRACE | 890 | #ifdef XFS_BMAP_TRACE |
888 | ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); | 891 | ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); |
889 | #endif | 892 | #endif |
@@ -2729,6 +2732,10 @@ xfs_idestroy( | |||
2729 | mrfree(&ip->i_lock); | 2732 | mrfree(&ip->i_lock); |
2730 | mrfree(&ip->i_iolock); | 2733 | mrfree(&ip->i_iolock); |
2731 | freesema(&ip->i_flock); | 2734 | freesema(&ip->i_flock); |
2735 | |||
2736 | #ifdef XFS_VNODE_TRACE | ||
2737 | ktrace_free(ip->i_trace); | ||
2738 | #endif | ||
2732 | #ifdef XFS_BMAP_TRACE | 2739 | #ifdef XFS_BMAP_TRACE |
2733 | ktrace_free(ip->i_xtrace); | 2740 | ktrace_free(ip->i_xtrace); |
2734 | #endif | 2741 | #endif |
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index c8bb1a818a5..8a1457280f1 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -301,6 +301,9 @@ typedef struct xfs_inode { | |||
301 | xfs_fsize_t i_size; /* in-memory size */ | 301 | xfs_fsize_t i_size; /* in-memory size */ |
302 | atomic_t i_iocount; /* outstanding I/O count */ | 302 | atomic_t i_iocount; /* outstanding I/O count */ |
303 | /* Trace buffers per inode. */ | 303 | /* Trace buffers per inode. */ |
304 | #ifdef XFS_VNODE_TRACE | ||
305 | struct ktrace *i_trace; /* general inode trace */ | ||
306 | #endif | ||
304 | #ifdef XFS_BMAP_TRACE | 307 | #ifdef XFS_BMAP_TRACE |
305 | struct ktrace *i_xtrace; /* inode extent list trace */ | 308 | struct ktrace *i_xtrace; /* inode extent list trace */ |
306 | #endif | 309 | #endif |
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index 2f5c8740b25..44ea0ba3647 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c | |||
@@ -247,8 +247,8 @@ xfs_rename( | |||
247 | int src_namelen = VNAMELEN(src_vname); | 247 | int src_namelen = VNAMELEN(src_vname); |
248 | int target_namelen = VNAMELEN(target_vname); | 248 | int target_namelen = VNAMELEN(target_vname); |
249 | 249 | ||
250 | vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address); | 250 | vn_trace_entry(src_dp, "xfs_rename", (inst_t *)__return_address); |
251 | vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address); | 251 | vn_trace_entry(xfs_vtoi(target_dir_vp), "xfs_rename", (inst_t *)__return_address); |
252 | 252 | ||
253 | /* | 253 | /* |
254 | * Find the XFS behavior descriptor for the target directory | 254 | * Find the XFS behavior descriptor for the target directory |
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c index 4a7208ef7fa..673b405eaa3 100644 --- a/fs/xfs/xfs_utils.c +++ b/fs/xfs/xfs_utils.c | |||
@@ -73,7 +73,7 @@ xfs_dir_lookup_int( | |||
73 | { | 73 | { |
74 | int error; | 74 | int error; |
75 | 75 | ||
76 | vn_trace_entry(XFS_ITOV(dp), __FUNCTION__, (inst_t *)__return_address); | 76 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
77 | 77 | ||
78 | error = xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), inum); | 78 | error = xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), inum); |
79 | if (!error) { | 79 | if (!error) { |
diff --git a/fs/xfs/xfs_utils.h b/fs/xfs/xfs_utils.h index 35c7a99f50a..a00b26d8840 100644 --- a/fs/xfs/xfs_utils.h +++ b/fs/xfs/xfs_utils.h | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #define IRELE(ip) VN_RELE(XFS_ITOV(ip)) | 21 | #define IRELE(ip) VN_RELE(XFS_ITOV(ip)) |
22 | #define IHOLD(ip) VN_HOLD(XFS_ITOV(ip)) | 22 | #define IHOLD(ip) VN_HOLD(XFS_ITOV(ip)) |
23 | #define ITRACE(ip) vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \ | 23 | #define ITRACE(ip) vn_trace_ref(ip, __FILE__, __LINE__, \ |
24 | (inst_t *)__return_address) | 24 | (inst_t *)__return_address) |
25 | 25 | ||
26 | extern int xfs_get_dir_entry (bhv_vname_t *, xfs_inode_t **); | 26 | extern int xfs_get_dir_entry (bhv_vname_t *, xfs_inode_t **); |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index e7ef78fb4da..98653793b34 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -88,7 +88,7 @@ xfs_getattr( | |||
88 | bhv_vnode_t *vp = XFS_ITOV(ip); | 88 | bhv_vnode_t *vp = XFS_ITOV(ip); |
89 | xfs_mount_t *mp = ip->i_mount; | 89 | xfs_mount_t *mp = ip->i_mount; |
90 | 90 | ||
91 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 91 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
92 | 92 | ||
93 | if (XFS_FORCED_SHUTDOWN(mp)) | 93 | if (XFS_FORCED_SHUTDOWN(mp)) |
94 | return XFS_ERROR(EIO); | 94 | return XFS_ERROR(EIO); |
@@ -228,7 +228,7 @@ xfs_setattr( | |||
228 | int file_owner; | 228 | int file_owner; |
229 | int need_iolock = 1; | 229 | int need_iolock = 1; |
230 | 230 | ||
231 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 231 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
232 | 232 | ||
233 | if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) | 233 | if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) |
234 | return XFS_ERROR(EROFS); | 234 | return XFS_ERROR(EROFS); |
@@ -915,7 +915,7 @@ xfs_access( | |||
915 | { | 915 | { |
916 | int error; | 916 | int error; |
917 | 917 | ||
918 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 918 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
919 | 919 | ||
920 | xfs_ilock(ip, XFS_ILOCK_SHARED); | 920 | xfs_ilock(ip, XFS_ILOCK_SHARED); |
921 | error = xfs_iaccess(ip, mode, credp); | 921 | error = xfs_iaccess(ip, mode, credp); |
@@ -987,7 +987,7 @@ xfs_readlink( | |||
987 | int pathlen; | 987 | int pathlen; |
988 | int error = 0; | 988 | int error = 0; |
989 | 989 | ||
990 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 990 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
991 | 991 | ||
992 | if (XFS_FORCED_SHUTDOWN(mp)) | 992 | if (XFS_FORCED_SHUTDOWN(mp)) |
993 | return XFS_ERROR(EIO); | 993 | return XFS_ERROR(EIO); |
@@ -1033,7 +1033,7 @@ xfs_fsync( | |||
1033 | int error; | 1033 | int error; |
1034 | int log_flushed = 0, changed = 1; | 1034 | int log_flushed = 0, changed = 1; |
1035 | 1035 | ||
1036 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 1036 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
1037 | 1037 | ||
1038 | ASSERT(start >= 0 && stop >= -1); | 1038 | ASSERT(start >= 0 && stop >= -1); |
1039 | 1039 | ||
@@ -1592,7 +1592,7 @@ xfs_inactive( | |||
1592 | int error; | 1592 | int error; |
1593 | int truncate; | 1593 | int truncate; |
1594 | 1594 | ||
1595 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 1595 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
1596 | 1596 | ||
1597 | /* | 1597 | /* |
1598 | * If the inode is already free, then there can be nothing | 1598 | * If the inode is already free, then there can be nothing |
@@ -1805,7 +1805,7 @@ xfs_lookup( | |||
1805 | int error; | 1805 | int error; |
1806 | uint lock_mode; | 1806 | uint lock_mode; |
1807 | 1807 | ||
1808 | vn_trace_entry(XFS_ITOV(dp), __FUNCTION__, (inst_t *)__return_address); | 1808 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
1809 | 1809 | ||
1810 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) | 1810 | if (XFS_FORCED_SHUTDOWN(dp->i_mount)) |
1811 | return XFS_ERROR(EIO); | 1811 | return XFS_ERROR(EIO); |
@@ -1849,7 +1849,7 @@ xfs_create( | |||
1849 | int namelen; | 1849 | int namelen; |
1850 | 1850 | ||
1851 | ASSERT(!*vpp); | 1851 | ASSERT(!*vpp); |
1852 | vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); | 1852 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
1853 | 1853 | ||
1854 | dm_di_mode = vap->va_mode; | 1854 | dm_di_mode = vap->va_mode; |
1855 | namelen = VNAMELEN(dentry); | 1855 | namelen = VNAMELEN(dentry); |
@@ -2326,7 +2326,7 @@ xfs_remove( | |||
2326 | uint resblks; | 2326 | uint resblks; |
2327 | int namelen; | 2327 | int namelen; |
2328 | 2328 | ||
2329 | vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); | 2329 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
2330 | 2330 | ||
2331 | if (XFS_FORCED_SHUTDOWN(mp)) | 2331 | if (XFS_FORCED_SHUTDOWN(mp)) |
2332 | return XFS_ERROR(EIO); | 2332 | return XFS_ERROR(EIO); |
@@ -2369,7 +2369,7 @@ xfs_remove( | |||
2369 | 2369 | ||
2370 | dm_di_mode = ip->i_d.di_mode; | 2370 | dm_di_mode = ip->i_d.di_mode; |
2371 | 2371 | ||
2372 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 2372 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
2373 | 2373 | ||
2374 | ITRACE(ip); | 2374 | ITRACE(ip); |
2375 | 2375 | ||
@@ -2503,7 +2503,7 @@ xfs_remove( | |||
2503 | if (link_zero && xfs_inode_is_filestream(ip)) | 2503 | if (link_zero && xfs_inode_is_filestream(ip)) |
2504 | xfs_filestream_deassociate(ip); | 2504 | xfs_filestream_deassociate(ip); |
2505 | 2505 | ||
2506 | vn_trace_exit(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 2506 | vn_trace_exit(ip, __FUNCTION__, (inst_t *)__return_address); |
2507 | 2507 | ||
2508 | IRELE(ip); | 2508 | IRELE(ip); |
2509 | 2509 | ||
@@ -2567,8 +2567,8 @@ xfs_link( | |||
2567 | char *target_name = VNAME(dentry); | 2567 | char *target_name = VNAME(dentry); |
2568 | int target_namelen; | 2568 | int target_namelen; |
2569 | 2569 | ||
2570 | vn_trace_entry(target_dir_vp, __FUNCTION__, (inst_t *)__return_address); | 2570 | vn_trace_entry(tdp, __FUNCTION__, (inst_t *)__return_address); |
2571 | vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); | 2571 | vn_trace_entry(xfs_vtoi(src_vp), __FUNCTION__, (inst_t *)__return_address); |
2572 | 2572 | ||
2573 | target_namelen = VNAMELEN(dentry); | 2573 | target_namelen = VNAMELEN(dentry); |
2574 | ASSERT(!VN_ISDIR(src_vp)); | 2574 | ASSERT(!VN_ISDIR(src_vp)); |
@@ -2751,7 +2751,7 @@ xfs_mkdir( | |||
2751 | 2751 | ||
2752 | /* Return through std_return after this point. */ | 2752 | /* Return through std_return after this point. */ |
2753 | 2753 | ||
2754 | vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); | 2754 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
2755 | 2755 | ||
2756 | mp = dp->i_mount; | 2756 | mp = dp->i_mount; |
2757 | udqp = gdqp = NULL; | 2757 | udqp = gdqp = NULL; |
@@ -2945,7 +2945,7 @@ xfs_rmdir( | |||
2945 | int last_cdp_link; | 2945 | int last_cdp_link; |
2946 | uint resblks; | 2946 | uint resblks; |
2947 | 2947 | ||
2948 | vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); | 2948 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
2949 | 2949 | ||
2950 | if (XFS_FORCED_SHUTDOWN(mp)) | 2950 | if (XFS_FORCED_SHUTDOWN(mp)) |
2951 | return XFS_ERROR(EIO); | 2951 | return XFS_ERROR(EIO); |
@@ -3198,7 +3198,7 @@ xfs_symlink( | |||
3198 | ip = NULL; | 3198 | ip = NULL; |
3199 | tp = NULL; | 3199 | tp = NULL; |
3200 | 3200 | ||
3201 | vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); | 3201 | vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address); |
3202 | 3202 | ||
3203 | 3203 | ||
3204 | if (XFS_FORCED_SHUTDOWN(mp)) | 3204 | if (XFS_FORCED_SHUTDOWN(mp)) |
@@ -3490,7 +3490,7 @@ xfs_fid2( | |||
3490 | { | 3490 | { |
3491 | xfs_fid2_t *xfid = (xfs_fid2_t *)fidp; | 3491 | xfs_fid2_t *xfid = (xfs_fid2_t *)fidp; |
3492 | 3492 | ||
3493 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 3493 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
3494 | ASSERT(sizeof(fid_t) >= sizeof(xfs_fid2_t)); | 3494 | ASSERT(sizeof(fid_t) >= sizeof(xfs_fid2_t)); |
3495 | 3495 | ||
3496 | xfid->fid_len = sizeof(xfs_fid2_t) - sizeof(xfid->fid_len); | 3496 | xfid->fid_len = sizeof(xfs_fid2_t) - sizeof(xfid->fid_len); |
@@ -3673,7 +3673,7 @@ xfs_reclaim( | |||
3673 | { | 3673 | { |
3674 | bhv_vnode_t *vp = XFS_ITOV(ip); | 3674 | bhv_vnode_t *vp = XFS_ITOV(ip); |
3675 | 3675 | ||
3676 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 3676 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
3677 | 3677 | ||
3678 | ASSERT(!VN_MAPPED(vp)); | 3678 | ASSERT(!VN_MAPPED(vp)); |
3679 | 3679 | ||
@@ -3891,7 +3891,7 @@ xfs_alloc_file_space( | |||
3891 | int committed; | 3891 | int committed; |
3892 | int error; | 3892 | int error; |
3893 | 3893 | ||
3894 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 3894 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
3895 | 3895 | ||
3896 | if (XFS_FORCED_SHUTDOWN(mp)) | 3896 | if (XFS_FORCED_SHUTDOWN(mp)) |
3897 | return XFS_ERROR(EIO); | 3897 | return XFS_ERROR(EIO); |
@@ -4161,7 +4161,7 @@ xfs_free_file_space( | |||
4161 | vp = XFS_ITOV(ip); | 4161 | vp = XFS_ITOV(ip); |
4162 | mp = ip->i_mount; | 4162 | mp = ip->i_mount; |
4163 | 4163 | ||
4164 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 4164 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
4165 | 4165 | ||
4166 | if ((error = XFS_QM_DQATTACH(mp, ip, 0))) | 4166 | if ((error = XFS_QM_DQATTACH(mp, ip, 0))) |
4167 | return error; | 4167 | return error; |
@@ -4367,7 +4367,7 @@ xfs_change_file_space( | |||
4367 | xfs_trans_t *tp; | 4367 | xfs_trans_t *tp; |
4368 | bhv_vattr_t va; | 4368 | bhv_vattr_t va; |
4369 | 4369 | ||
4370 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 4370 | vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); |
4371 | 4371 | ||
4372 | /* | 4372 | /* |
4373 | * must be a regular file and have write permission | 4373 | * must be a regular file and have write permission |