aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_vnode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-28 21:46:47 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 21:39:25 -0400
commit1543d79c45a374f934f95ca34d87e2eeeb2039b4 (patch)
treeabe537e7c241f2a764687c54d805ebfdb5147e3c /fs/xfs/linux-2.6/xfs_vnode.c
parentb677c210cec0d6755335ffc01691982c417dd39e (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/linux-2.6/xfs_vnode.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c46
1 files changed, 27 insertions, 19 deletions
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 */
198static 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 */
215void 223void
216vn_trace_entry(bhv_vnode_t *vp, const char *func, inst_t *ra) 224vn_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
221void 229void
222vn_trace_exit(bhv_vnode_t *vp, const char *func, inst_t *ra) 230vn_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
227void 235void
228vn_trace_hold(bhv_vnode_t *vp, char *file, int line, inst_t *ra) 236vn_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
233void 241void
234vn_trace_ref(bhv_vnode_t *vp, char *file, int line, inst_t *ra) 242vn_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
239void 247void
240vn_trace_rele(bhv_vnode_t *vp, char *file, int line, inst_t *ra) 248vn_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 */