aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 00:42:19 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 00:42:19 -0500
commitcf441eeb79c32471379f0a4d97feaef691432a03 (patch)
tree283347fcc807a87339a8244d3a45029eac90c825 /fs/xfs/linux-2.6
parent44866d39282d0782b15fa4cb62aad937bf0a0897 (diff)
[XFS] clean up vnode/inode tracing
Simplify vnode tracing calls by embedding function name & return addr in the calling macro. Also do a lot of vnode->inode renaming for consistency, while we're at it. SGI-PV: 970335 SGI-Modid: xfs-linux-melb:xfs-kern:29650a Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c9
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c26
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h51
5 files changed, 47 insertions, 45 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 2e34b104107c..31269cbd5e1a 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1525,8 +1525,7 @@ xfs_vm_bmap(
1525 struct inode *inode = (struct inode *)mapping->host; 1525 struct inode *inode = (struct inode *)mapping->host;
1526 struct xfs_inode *ip = XFS_I(inode); 1526 struct xfs_inode *ip = XFS_I(inode);
1527 1527
1528 vn_trace_entry(XFS_I(inode), __FUNCTION__, 1528 xfs_itrace_entry(XFS_I(inode));
1529 (inst_t *)__return_address);
1530 xfs_rwlock(ip, VRWLOCK_READ); 1529 xfs_rwlock(ip, VRWLOCK_READ);
1531 xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); 1530 xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
1532 xfs_rwunlock(ip, VRWLOCK_READ); 1531 xfs_rwunlock(ip, VRWLOCK_READ);
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 98a56568bb24..30bb994d2899 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -739,8 +739,7 @@ xfs_ioctl(
739 xfs_mount_t *mp = ip->i_mount; 739 xfs_mount_t *mp = ip->i_mount;
740 int error; 740 int error;
741 741
742 vn_trace_entry(XFS_I(inode), "xfs_ioctl", (inst_t *)__return_address); 742 xfs_itrace_entry(XFS_I(inode));
743
744 switch (cmd) { 743 switch (cmd) {
745 744
746 case XFS_IOC_ALLOCSP: 745 case XFS_IOC_ALLOCSP:
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 8cb63c60c048..400ed2f20717 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -410,8 +410,7 @@ xfs_fs_write_inode(
410{ 410{
411 int error = 0, flags = FLUSH_INODE; 411 int error = 0, flags = FLUSH_INODE;
412 412
413 vn_trace_entry(XFS_I(inode), __FUNCTION__, 413 xfs_itrace_entry(XFS_I(inode));
414 (inst_t *)__return_address);
415 if (sync) { 414 if (sync) {
416 filemap_fdatawait(inode->i_mapping); 415 filemap_fdatawait(inode->i_mapping);
417 flags |= FLUSH_SYNC; 416 flags |= FLUSH_SYNC;
@@ -438,8 +437,7 @@ xfs_fs_clear_inode(
438 * find an inode with di_mode == 0 but without IGET_CREATE set. 437 * find an inode with di_mode == 0 but without IGET_CREATE set.
439 */ 438 */
440 if (ip) { 439 if (ip) {
441 vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address); 440 xfs_itrace_entry(ip);
442
443 XFS_STATS_INC(vn_rele); 441 XFS_STATS_INC(vn_rele);
444 XFS_STATS_INC(vn_remove); 442 XFS_STATS_INC(vn_remove);
445 XFS_STATS_INC(vn_reclaim); 443 XFS_STATS_INC(vn_reclaim);
@@ -841,8 +839,7 @@ xfs_fs_fill_super(
841 goto fail_vnrele; 839 goto fail_vnrele;
842 } 840 }
843 841
844 vn_trace_exit(XFS_I(sb->s_root->d_inode), __FUNCTION__, 842 xfs_itrace_exit(XFS_I(sb->s_root->d_inode));
845 (inst_t *)__return_address);
846 843
847 kmem_free(args, sizeof(*args)); 844 kmem_free(args, sizeof(*args));
848 return 0; 845 return 0;
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 814169fd7e1e..e16b3e40015d 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -143,7 +143,7 @@ __vn_revalidate(
143{ 143{
144 int error; 144 int error;
145 145
146 vn_trace_entry(xfs_vtoi(vp), __FUNCTION__, (inst_t *)__return_address); 146 xfs_itrace_entry(xfs_vtoi(vp));
147 vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; 147 vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS;
148 error = xfs_getattr(xfs_vtoi(vp), vattr, 0); 148 error = xfs_getattr(xfs_vtoi(vp), vattr, 0);
149 if (likely(!error)) { 149 if (likely(!error)) {
@@ -179,7 +179,7 @@ vn_hold(
179 return vp; 179 return vp;
180} 180}
181 181
182#ifdef XFS_VNODE_TRACE 182#ifdef XFS_INODE_TRACE
183 183
184/* 184/*
185 * Reference count of Linux inode if present, -1 if the xfs_inode 185 * Reference count of Linux inode if present, -1 if the xfs_inode
@@ -211,32 +211,32 @@ static inline int xfs_icount(struct xfs_inode *ip)
211 * Vnode tracing code. 211 * Vnode tracing code.
212 */ 212 */
213void 213void
214vn_trace_entry(xfs_inode_t *ip, const char *func, inst_t *ra) 214_xfs_itrace_entry(xfs_inode_t *ip, const char *func, inst_t *ra)
215{ 215{
216 KTRACE_ENTER(ip, VNODE_KTRACE_ENTRY, func, 0, ra); 216 KTRACE_ENTER(ip, INODE_KTRACE_ENTRY, func, 0, ra);
217} 217}
218 218
219void 219void
220vn_trace_exit(xfs_inode_t *ip, const char *func, inst_t *ra) 220_xfs_itrace_exit(xfs_inode_t *ip, const char *func, inst_t *ra)
221{ 221{
222 KTRACE_ENTER(ip, VNODE_KTRACE_EXIT, func, 0, ra); 222 KTRACE_ENTER(ip, INODE_KTRACE_EXIT, func, 0, ra);
223} 223}
224 224
225void 225void
226vn_trace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra) 226xfs_itrace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra)
227{ 227{
228 KTRACE_ENTER(ip, VNODE_KTRACE_HOLD, file, line, ra); 228 KTRACE_ENTER(ip, INODE_KTRACE_HOLD, file, line, ra);
229} 229}
230 230
231void 231void
232vn_trace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra) 232_xfs_itrace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra)
233{ 233{
234 KTRACE_ENTER(ip, VNODE_KTRACE_REF, file, line, ra); 234 KTRACE_ENTER(ip, INODE_KTRACE_REF, file, line, ra);
235} 235}
236 236
237void 237void
238vn_trace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra) 238xfs_itrace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra)
239{ 239{
240 KTRACE_ENTER(ip, VNODE_KTRACE_RELE, file, line, ra); 240 KTRACE_ENTER(ip, INODE_KTRACE_RELE, file, line, ra);
241} 241}
242#endif /* XFS_VNODE_TRACE */ 242#endif /* XFS_INODE_TRACE */
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 55fb46948589..09763067da11 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -210,12 +210,12 @@ static inline int vn_count(bhv_vnode_t *vp)
210 */ 210 */
211extern bhv_vnode_t *vn_hold(bhv_vnode_t *); 211extern bhv_vnode_t *vn_hold(bhv_vnode_t *);
212 212
213#if defined(XFS_VNODE_TRACE) 213#if defined(XFS_INODE_TRACE)
214#define VN_HOLD(vp) \ 214#define VN_HOLD(vp) \
215 ((void)vn_hold(vp), \ 215 ((void)vn_hold(vp), \
216 vn_trace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address)) 216 xfs_itrace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address))
217#define VN_RELE(vp) \ 217#define VN_RELE(vp) \
218 (vn_trace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ 218 (xfs_itrace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \
219 iput(vn_to_inode(vp))) 219 iput(vn_to_inode(vp)))
220#else 220#else
221#define VN_HOLD(vp) ((void)vn_hold(vp)) 221#define VN_HOLD(vp) ((void)vn_hold(vp))
@@ -296,26 +296,33 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
296/* 296/*
297 * Tracking vnode activity. 297 * Tracking vnode activity.
298 */ 298 */
299#if defined(XFS_VNODE_TRACE) 299#if defined(XFS_INODE_TRACE)
300 300
301#define VNODE_TRACE_SIZE 16 /* number of trace entries */ 301#define INODE_TRACE_SIZE 16 /* number of trace entries */
302#define VNODE_KTRACE_ENTRY 1 302#define INODE_KTRACE_ENTRY 1
303#define VNODE_KTRACE_EXIT 2 303#define INODE_KTRACE_EXIT 2
304#define VNODE_KTRACE_HOLD 3 304#define INODE_KTRACE_HOLD 3
305#define VNODE_KTRACE_REF 4 305#define INODE_KTRACE_REF 4
306#define VNODE_KTRACE_RELE 5 306#define INODE_KTRACE_RELE 5
307 307
308extern void vn_trace_entry(struct xfs_inode *, const char *, inst_t *); 308extern void _xfs_itrace_entry(struct xfs_inode *, const char *, inst_t *);
309extern void vn_trace_exit(struct xfs_inode *, const char *, inst_t *); 309extern void _xfs_itrace_exit(struct xfs_inode *, const char *, inst_t *);
310extern void vn_trace_hold(struct xfs_inode *, char *, int, inst_t *); 310extern void xfs_itrace_hold(struct xfs_inode *, char *, int, inst_t *);
311extern void vn_trace_ref(struct xfs_inode *, char *, int, inst_t *); 311extern void _xfs_itrace_ref(struct xfs_inode *, char *, int, inst_t *);
312extern void vn_trace_rele(struct xfs_inode *, char *, int, inst_t *); 312extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *);
313#define xfs_itrace_entry(ip) \
314 _xfs_itrace_entry(ip, __FUNCTION__, (inst_t *)__return_address)
315#define xfs_itrace_exit(ip) \
316 _xfs_itrace_exit(ip, __FUNCTION__, (inst_t *)__return_address)
317#define xfs_itrace_ref(ip) \
318 _xfs_itrace_ref(ip, __FILE__, __LINE__, (inst_t *)__return_address)
319
313#else 320#else
314#define vn_trace_entry(a,b,c) 321#define xfs_itrace_entry(a)
315#define vn_trace_exit(a,b,c) 322#define xfs_itrace_exit(a)
316#define vn_trace_hold(a,b,c,d) 323#define xfs_itrace_hold(a, b, c, d)
317#define vn_trace_ref(a,b,c,d) 324#define xfs_itrace_ref(a)
318#define vn_trace_rele(a,b,c,d) 325#define xfs_itrace_rele(a, b, c, d)
319#endif 326#endif
320 327
321#endif /* __XFS_VNODE_H__ */ 328#endif /* __XFS_VNODE_H__ */