aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-12-03 06:20:40 -0500
committerNiv Sardi <xaiki@sgi.com>2008-12-03 23:39:25 -0500
commit5a8d0f3c7af801c7263fbba39952504d6fc7ff60 (patch)
tree64e376493be44232ac1c0d66e2a68c5280f42ec1 /fs
parent25e41b3d521f52771354a718042a753a3e77df0a (diff)
move inode tracing out of xfs_vnode.
Move the inode tracing into xfs_iget.c / xfs_inode.h and kill xfs_vnode.c now that it's empty. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/Makefile1
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c82
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h48
-rw-r--r--fs/xfs/xfs_iget.c48
-rw-r--r--fs/xfs/xfs_inode.h45
5 files changed, 93 insertions, 131 deletions
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index a5a9ef0ce843..c3dc491fff89 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -107,7 +107,6 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \
107 xfs_lrw.o \ 107 xfs_lrw.o \
108 xfs_super.o \ 108 xfs_super.o \
109 xfs_sync.o \ 109 xfs_sync.o \
110 xfs_vnode.o \
111 xfs_xattr.o) 110 xfs_xattr.o)
112 111
113# Objects in support/ 112# Objects in support/
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
deleted file mode 100644
index f6d141122792..000000000000
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#include "xfs.h"
19#include "xfs_vnodeops.h"
20#include "xfs_bmap_btree.h"
21#include "xfs_inode.h"
22
23/*
24 * And this gunk is needed for xfs_mount.h"
25 */
26#include "xfs_log.h"
27#include "xfs_trans.h"
28#include "xfs_sb.h"
29#include "xfs_dmapi.h"
30#include "xfs_inum.h"
31#include "xfs_ag.h"
32#include "xfs_mount.h"
33
34
35#ifdef XFS_INODE_TRACE
36
37#define KTRACE_ENTER(ip, vk, s, line, ra) \
38 ktrace_enter( (ip)->i_trace, \
39/* 0 */ (void *)(__psint_t)(vk), \
40/* 1 */ (void *)(s), \
41/* 2 */ (void *)(__psint_t) line, \
42/* 3 */ (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count), \
43/* 4 */ (void *)(ra), \
44/* 5 */ NULL, \
45/* 6 */ (void *)(__psint_t)current_cpu(), \
46/* 7 */ (void *)(__psint_t)current_pid(), \
47/* 8 */ (void *)__return_address, \
48/* 9 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL)
49
50/*
51 * Vnode tracing code.
52 */
53void
54_xfs_itrace_entry(xfs_inode_t *ip, const char *func, inst_t *ra)
55{
56 KTRACE_ENTER(ip, INODE_KTRACE_ENTRY, func, 0, ra);
57}
58
59void
60_xfs_itrace_exit(xfs_inode_t *ip, const char *func, inst_t *ra)
61{
62 KTRACE_ENTER(ip, INODE_KTRACE_EXIT, func, 0, ra);
63}
64
65void
66xfs_itrace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra)
67{
68 KTRACE_ENTER(ip, INODE_KTRACE_HOLD, file, line, ra);
69}
70
71void
72_xfs_itrace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra)
73{
74 KTRACE_ENTER(ip, INODE_KTRACE_REF, file, line, ra);
75}
76
77void
78xfs_itrace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra)
79{
80 KTRACE_ENTER(ip, INODE_KTRACE_RELE, file, line, ra);
81}
82#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 bd3e05c47903..f65983a230d3 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -54,19 +54,6 @@ struct attrlist_cursor_kern;
54 Prevent VM access to the pages until 54 Prevent VM access to the pages until
55 the operation completes. */ 55 the operation completes. */
56 56
57#define IHOLD(ip) \
58do { \
59 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
60 atomic_inc(&(VFS_I(ip)->i_count)); \
61 xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \
62} while (0)
63
64#define IRELE(ip) \
65do { \
66 xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \
67 iput(VFS_I(ip)); \
68} while (0)
69
70/* 57/*
71 * Dealing with bad inodes 58 * Dealing with bad inodes
72 */ 59 */
@@ -103,39 +90,4 @@ static inline void vn_atime_to_time_t(struct inode *vp, time_t *tt)
103 PAGECACHE_TAG_DIRTY) 90 PAGECACHE_TAG_DIRTY)
104 91
105 92
106/*
107 * Tracking vnode activity.
108 */
109#if defined(XFS_INODE_TRACE)
110
111#define INODE_TRACE_SIZE 16 /* number of trace entries */
112#define INODE_KTRACE_ENTRY 1
113#define INODE_KTRACE_EXIT 2
114#define INODE_KTRACE_HOLD 3
115#define INODE_KTRACE_REF 4
116#define INODE_KTRACE_RELE 5
117
118extern void _xfs_itrace_entry(struct xfs_inode *, const char *, inst_t *);
119extern void _xfs_itrace_exit(struct xfs_inode *, const char *, inst_t *);
120extern void xfs_itrace_hold(struct xfs_inode *, char *, int, inst_t *);
121extern void _xfs_itrace_ref(struct xfs_inode *, char *, int, inst_t *);
122extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *);
123#define xfs_itrace_entry(ip) \
124 _xfs_itrace_entry(ip, __func__, (inst_t *)__return_address)
125#define xfs_itrace_exit(ip) \
126 _xfs_itrace_exit(ip, __func__, (inst_t *)__return_address)
127#define xfs_itrace_exit_tag(ip, tag) \
128 _xfs_itrace_exit(ip, tag, (inst_t *)__return_address)
129#define xfs_itrace_ref(ip) \
130 _xfs_itrace_ref(ip, __FILE__, __LINE__, (inst_t *)__return_address)
131
132#else
133#define xfs_itrace_entry(a)
134#define xfs_itrace_exit(a)
135#define xfs_itrace_exit_tag(a, b)
136#define xfs_itrace_hold(a, b, c, d)
137#define xfs_itrace_ref(a)
138#define xfs_itrace_rele(a, b, c, d)
139#endif
140
141#endif /* __XFS_VNODE_H__ */ 93#endif /* __XFS_VNODE_H__ */
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 82eb8ed56338..e2fb6210d4c5 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -805,3 +805,51 @@ xfs_isilocked(
805} 805}
806#endif 806#endif
807 807
808#ifdef XFS_INODE_TRACE
809
810#define KTRACE_ENTER(ip, vk, s, line, ra) \
811 ktrace_enter((ip)->i_trace, \
812/* 0 */ (void *)(__psint_t)(vk), \
813/* 1 */ (void *)(s), \
814/* 2 */ (void *)(__psint_t) line, \
815/* 3 */ (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count), \
816/* 4 */ (void *)(ra), \
817/* 5 */ NULL, \
818/* 6 */ (void *)(__psint_t)current_cpu(), \
819/* 7 */ (void *)(__psint_t)current_pid(), \
820/* 8 */ (void *)__return_address, \
821/* 9 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL)
822
823/*
824 * Vnode tracing code.
825 */
826void
827_xfs_itrace_entry(xfs_inode_t *ip, const char *func, inst_t *ra)
828{
829 KTRACE_ENTER(ip, INODE_KTRACE_ENTRY, func, 0, ra);
830}
831
832void
833_xfs_itrace_exit(xfs_inode_t *ip, const char *func, inst_t *ra)
834{
835 KTRACE_ENTER(ip, INODE_KTRACE_EXIT, func, 0, ra);
836}
837
838void
839xfs_itrace_hold(xfs_inode_t *ip, char *file, int line, inst_t *ra)
840{
841 KTRACE_ENTER(ip, INODE_KTRACE_HOLD, file, line, ra);
842}
843
844void
845_xfs_itrace_ref(xfs_inode_t *ip, char *file, int line, inst_t *ra)
846{
847 KTRACE_ENTER(ip, INODE_KTRACE_REF, file, line, ra);
848}
849
850void
851xfs_itrace_rele(xfs_inode_t *ip, char *file, int line, inst_t *ra)
852{
853 KTRACE_ENTER(ip, INODE_KTRACE_RELE, file, line, ra);
854}
855#endif /* XFS_INODE_TRACE */
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index ddac1b806c0b..558253e6fb43 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -536,6 +536,51 @@ void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint);
536void xfs_synchronize_atime(xfs_inode_t *); 536void xfs_synchronize_atime(xfs_inode_t *);
537void xfs_mark_inode_dirty_sync(xfs_inode_t *); 537void xfs_mark_inode_dirty_sync(xfs_inode_t *);
538 538
539#if defined(XFS_INODE_TRACE)
540
541#define INODE_TRACE_SIZE 16 /* number of trace entries */
542#define INODE_KTRACE_ENTRY 1
543#define INODE_KTRACE_EXIT 2
544#define INODE_KTRACE_HOLD 3
545#define INODE_KTRACE_REF 4
546#define INODE_KTRACE_RELE 5
547
548extern void _xfs_itrace_entry(struct xfs_inode *, const char *, inst_t *);
549extern void _xfs_itrace_exit(struct xfs_inode *, const char *, inst_t *);
550extern void xfs_itrace_hold(struct xfs_inode *, char *, int, inst_t *);
551extern void _xfs_itrace_ref(struct xfs_inode *, char *, int, inst_t *);
552extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *);
553#define xfs_itrace_entry(ip) \
554 _xfs_itrace_entry(ip, __func__, (inst_t *)__return_address)
555#define xfs_itrace_exit(ip) \
556 _xfs_itrace_exit(ip, __func__, (inst_t *)__return_address)
557#define xfs_itrace_exit_tag(ip, tag) \
558 _xfs_itrace_exit(ip, tag, (inst_t *)__return_address)
559#define xfs_itrace_ref(ip) \
560 _xfs_itrace_ref(ip, __FILE__, __LINE__, (inst_t *)__return_address)
561
562#else
563#define xfs_itrace_entry(a)
564#define xfs_itrace_exit(a)
565#define xfs_itrace_exit_tag(a, b)
566#define xfs_itrace_hold(a, b, c, d)
567#define xfs_itrace_ref(a)
568#define xfs_itrace_rele(a, b, c, d)
569#endif
570
571#define IHOLD(ip) \
572do { \
573 ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \
574 atomic_inc(&(VFS_I(ip)->i_count)); \
575 xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \
576} while (0)
577
578#define IRELE(ip) \
579do { \
580 xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \
581 iput(VFS_I(ip)); \
582} while (0)
583
539#endif /* __KERNEL__ */ 584#endif /* __KERNEL__ */
540 585
541int xfs_inotobp(struct xfs_mount *, struct xfs_trans *, 586int xfs_inotobp(struct xfs_mount *, struct xfs_trans *,