blob: 5abcbd198d73f90d07078381a4f2c5f578920b40 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Nathan Scott7b718762005-11-02 14:58:39 +11002 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
Nathan Scott7b718762005-11-02 14:58:39 +11005 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * published by the Free Software Foundation.
8 *
Nathan Scott7b718762005-11-02 14:58:39 +11009 * 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
Nathan Scott7b718762005-11-02 14:58:39 +110014 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
18#ifndef __XFS_VNODE_H__
19#define __XFS_VNODE_H__
20
Linus Torvalds1da177e2005-04-16 15:20:36 -070021struct file;
Nathan Scott8285fb52006-06-09 17:07:12 +100022struct bhv_vfs;
23struct bhv_vattr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070024struct xfs_iomap;
25struct attrlist_cursor_kern;
26
Nathan Scott8285fb52006-06-09 17:07:12 +100027typedef struct dentry bhv_vname_t;
28typedef __u64 bhv_vnumber_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Nathan Scott8285fb52006-06-09 17:07:12 +100030typedef enum bhv_vflags {
Nathan Scott7d4fb402006-06-09 15:27:16 +100031 VMODIFIED = 0x08, /* XFS inode state possibly differs */
32 /* to the Linux inode state. */
33 VTRUNCATED = 0x40, /* truncated down so flush-on-close */
Nathan Scott8285fb52006-06-09 17:07:12 +100034} bhv_vflags_t;
Nathan Scott7d4fb402006-06-09 15:27:16 +100035
Linus Torvalds1da177e2005-04-16 15:20:36 -070036/*
37 * MP locking protocols:
38 * v_flag, v_vfsp VN_LOCK/VN_UNLOCK
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 */
Nathan Scott67fcaa72006-06-09 17:00:52 +100040typedef struct bhv_vnode {
Nathan Scott8285fb52006-06-09 17:07:12 +100041 bhv_vflags_t v_flag; /* vnode flags (see above) */
42 bhv_vfs_t *v_vfsp; /* ptr to containing VFS */
43 bhv_vnumber_t v_number; /* in-core vnode number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
Christoph Hellwig51c91ed52005-09-02 16:58:38 +100045 atomic_t v_iocount; /* outstanding I/O count */
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#ifdef XFS_VNODE_TRACE
47 struct ktrace *v_trace; /* trace header structure */
48#endif
Eric Sandeen9effd8e2005-05-05 13:26:18 -070049 struct inode v_inode; /* Linux inode */
50 /* inode MUST be last */
Nathan Scott67fcaa72006-06-09 17:00:52 +100051} bhv_vnode_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Christoph Hellwig0432dab2005-09-02 16:46:51 +100053#define VN_ISLNK(vp) S_ISLNK((vp)->v_inode.i_mode)
54#define VN_ISREG(vp) S_ISREG((vp)->v_inode.i_mode)
55#define VN_ISDIR(vp) S_ISDIR((vp)->v_inode.i_mode)
56#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode)
57#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode)
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059/*
60 * Vnode to Linux inode mapping.
61 */
Nathan Scott67fcaa72006-06-09 17:00:52 +100062static inline struct bhv_vnode *vn_from_inode(struct inode *inode)
Nathan Scottec86dc02006-03-17 17:25:36 +110063{
Alexey Dobriyan71306f32006-06-27 14:10:29 +100064 return container_of(inode, bhv_vnode_t, v_inode);
Nathan Scottec86dc02006-03-17 17:25:36 +110065}
Nathan Scott67fcaa72006-06-09 17:00:52 +100066static inline struct inode *vn_to_inode(struct bhv_vnode *vnode)
Nathan Scottec86dc02006-03-17 17:25:36 +110067{
68 return &vnode->v_inode;
69}
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71/*
Nathan Scott67fcaa72006-06-09 17:00:52 +100072 * Values for the vop_rwlock/rwunlock flags parameter.
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 */
Nathan Scott8285fb52006-06-09 17:07:12 +100074typedef enum bhv_vrwlock {
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 VRWLOCK_NONE,
76 VRWLOCK_READ,
77 VRWLOCK_WRITE,
78 VRWLOCK_WRITE_DIRECT,
79 VRWLOCK_TRY_READ,
80 VRWLOCK_TRY_WRITE
Nathan Scott8285fb52006-06-09 17:07:12 +100081} bhv_vrwlock_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
83/*
Christoph Hellwig739bfb22007-08-29 10:58:01 +100084 * Return values for xfs_inactive. A return value of
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 * VN_INACTIVE_NOCACHE implies that the file system behavior
86 * has disassociated its state and bhv_desc_t from the vnode.
87 */
88#define VN_INACTIVE_CACHE 0
89#define VN_INACTIVE_NOCACHE 1
90
91/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 * Flags for read/write calls - same values as IRIX
93 */
94#define IO_ISAIO 0x00001 /* don't wait for completion */
95#define IO_ISDIRECT 0x00004 /* bypass page cache */
96#define IO_INVIS 0x00020 /* don't update inode timestamps */
97
98/*
Nathan Scott67fcaa72006-06-09 17:00:52 +100099 * Flags for vop_iflush call
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 */
101#define FLUSH_SYNC 1 /* wait for flush to complete */
102#define FLUSH_INODE 2 /* flush the inode itself */
103#define FLUSH_LOG 4 /* force the last log entry for
104 * this inode out to disk */
105
106/*
Nathan Scott67fcaa72006-06-09 17:00:52 +1000107 * Flush/Invalidate options for vop_toss/flush/flushinval_pages.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 */
109#define FI_NONE 0 /* none */
110#define FI_REMAPF 1 /* Do a remapf prior to the operation */
111#define FI_REMAPF_LOCKED 2 /* Do a remapf prior to the operation.
112 Prevent VM access to the pages until
113 the operation completes. */
114
115/*
116 * Vnode attributes. va_mask indicates those attributes the caller
117 * wants to set or extract.
118 */
Nathan Scott8285fb52006-06-09 17:07:12 +1000119typedef struct bhv_vattr {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 int va_mask; /* bit-mask of attributes present */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 mode_t va_mode; /* file access mode and type */
Nathan Scott31b084a2005-05-05 13:25:00 -0700122 xfs_nlink_t va_nlink; /* number of references to file */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 uid_t va_uid; /* owner user id */
124 gid_t va_gid; /* owner group id */
125 xfs_ino_t va_nodeid; /* file id */
126 xfs_off_t va_size; /* file size in bytes */
127 u_long va_blocksize; /* blocksize preferred for i/o */
128 struct timespec va_atime; /* time of last access */
129 struct timespec va_mtime; /* time of last modification */
130 struct timespec va_ctime; /* time file changed */
131 u_int va_gen; /* generation number of file */
132 xfs_dev_t va_rdev; /* device the special file represents */
133 __int64_t va_nblocks; /* number of blocks allocated */
134 u_long va_xflags; /* random extended file flags */
135 u_long va_extsize; /* file extent size */
136 u_long va_nextents; /* number of extents in file */
137 u_long va_anextents; /* number of attr extents in file */
Nathan Scottb74e2152005-06-21 13:21:49 +1000138 prid_t va_projid; /* project id */
Nathan Scott8285fb52006-06-09 17:07:12 +1000139} bhv_vattr_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140
141/*
142 * setattr or getattr attributes
143 */
144#define XFS_AT_TYPE 0x00000001
145#define XFS_AT_MODE 0x00000002
146#define XFS_AT_UID 0x00000004
147#define XFS_AT_GID 0x00000008
148#define XFS_AT_FSID 0x00000010
149#define XFS_AT_NODEID 0x00000020
150#define XFS_AT_NLINK 0x00000040
151#define XFS_AT_SIZE 0x00000080
152#define XFS_AT_ATIME 0x00000100
153#define XFS_AT_MTIME 0x00000200
154#define XFS_AT_CTIME 0x00000400
155#define XFS_AT_RDEV 0x00000800
156#define XFS_AT_BLKSIZE 0x00001000
157#define XFS_AT_NBLOCKS 0x00002000
158#define XFS_AT_VCODE 0x00004000
159#define XFS_AT_MAC 0x00008000
160#define XFS_AT_UPDATIME 0x00010000
161#define XFS_AT_UPDMTIME 0x00020000
162#define XFS_AT_UPDCTIME 0x00040000
163#define XFS_AT_ACL 0x00080000
164#define XFS_AT_CAP 0x00100000
165#define XFS_AT_INF 0x00200000
166#define XFS_AT_XFLAGS 0x00400000
167#define XFS_AT_EXTSIZE 0x00800000
168#define XFS_AT_NEXTENTS 0x01000000
169#define XFS_AT_ANEXTENTS 0x02000000
170#define XFS_AT_PROJID 0x04000000
171#define XFS_AT_SIZE_NOPERM 0x08000000
172#define XFS_AT_GENCOUNT 0x10000000
173
174#define XFS_AT_ALL (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
175 XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
176 XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
177 XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|XFS_AT_MAC|\
178 XFS_AT_ACL|XFS_AT_CAP|XFS_AT_INF|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|\
179 XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT)
180
181#define XFS_AT_STAT (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
182 XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
183 XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
184 XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_PROJID)
185
186#define XFS_AT_TIMES (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME)
187
188#define XFS_AT_UPDTIMES (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME)
189
190#define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\
191 XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\
192 XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT)
193
194/*
195 * Modes.
196 */
197#define VSUID S_ISUID /* set user id on execution */
198#define VSGID S_ISGID /* set group id on execution */
199#define VSVTX S_ISVTX /* save swapped text even after use */
200#define VREAD S_IRUSR /* read, write, execute permissions */
201#define VWRITE S_IWUSR
202#define VEXEC S_IXUSR
203
204#define MODEMASK S_IALLUGO /* mode bits plus permission bits */
205
206/*
207 * Check whether mandatory file locking is enabled.
208 */
209#define MANDLOCK(vp, mode) \
Christoph Hellwig0432dab2005-09-02 16:46:51 +1000210 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211
212extern void vn_init(void);
Nathan Scott67fcaa72006-06-09 17:00:52 +1000213extern bhv_vnode_t *vn_initialize(struct inode *);
214extern int vn_revalidate(struct bhv_vnode *);
Nathan Scott8285fb52006-06-09 17:07:12 +1000215extern int __vn_revalidate(struct bhv_vnode *, bhv_vattr_t *);
216extern void vn_revalidate_core(struct bhv_vnode *, bhv_vattr_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217
Nathan Scott67fcaa72006-06-09 17:00:52 +1000218extern void vn_iowait(struct bhv_vnode *vp);
219extern void vn_iowake(struct bhv_vnode *vp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220
Nathan Scott67fcaa72006-06-09 17:00:52 +1000221extern void vn_ioerror(struct bhv_vnode *vp, int error, char *f, int l);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222
Nathan Scott67fcaa72006-06-09 17:00:52 +1000223static inline int vn_count(struct bhv_vnode *vp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224{
Nathan Scottec86dc02006-03-17 17:25:36 +1100225 return atomic_read(&vn_to_inode(vp)->i_count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226}
227
228/*
229 * Vnode reference counting functions (and macros for compatibility).
230 */
Nathan Scott67fcaa72006-06-09 17:00:52 +1000231extern bhv_vnode_t *vn_hold(struct bhv_vnode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232
233#if defined(XFS_VNODE_TRACE)
234#define VN_HOLD(vp) \
235 ((void)vn_hold(vp), \
236 vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address))
237#define VN_RELE(vp) \
238 (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \
Nathan Scottec86dc02006-03-17 17:25:36 +1100239 iput(vn_to_inode(vp)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240#else
241#define VN_HOLD(vp) ((void)vn_hold(vp))
Nathan Scottec86dc02006-03-17 17:25:36 +1100242#define VN_RELE(vp) (iput(vn_to_inode(vp)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243#endif
244
Nathan Scott67fcaa72006-06-09 17:00:52 +1000245static inline struct bhv_vnode *vn_grab(struct bhv_vnode *vp)
Christoph Hellwigcdb62682005-09-02 16:24:19 +1000246{
Nathan Scottec86dc02006-03-17 17:25:36 +1100247 struct inode *inode = igrab(vn_to_inode(vp));
248 return inode ? vn_from_inode(inode) : NULL;
Christoph Hellwigcdb62682005-09-02 16:24:19 +1000249}
250
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251/*
252 * Vname handling macros.
253 */
254#define VNAME(dentry) ((char *) (dentry)->d_name.name)
255#define VNAMELEN(dentry) ((dentry)->d_name.len)
Nathan Scottec86dc02006-03-17 17:25:36 +1100256#define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257
258/*
259 * Vnode spinlock manipulation.
260 */
261#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock)
262#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263
David Chinner7989cb82007-02-10 18:34:56 +1100264STATIC_INLINE void vn_flagset(struct bhv_vnode *vp, uint flag)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265{
266 spin_lock(&vp->v_lock);
267 vp->v_flag |= flag;
268 spin_unlock(&vp->v_lock);
269}
270
David Chinner7989cb82007-02-10 18:34:56 +1100271STATIC_INLINE uint vn_flagclr(struct bhv_vnode *vp, uint flag)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272{
Nathan Scott7d4fb402006-06-09 15:27:16 +1000273 uint cleared;
274
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 spin_lock(&vp->v_lock);
Nathan Scott7d4fb402006-06-09 15:27:16 +1000276 cleared = (vp->v_flag & flag);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 vp->v_flag &= ~flag;
278 spin_unlock(&vp->v_lock);
Nathan Scott7d4fb402006-06-09 15:27:16 +1000279 return cleared;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280}
281
Nathan Scott7d4fb402006-06-09 15:27:16 +1000282#define VMODIFY(vp) vn_flagset(vp, VMODIFIED)
283#define VUNMODIFY(vp) vn_flagclr(vp, VMODIFIED)
284#define VTRUNCATE(vp) vn_flagset(vp, VTRUNCATED)
285#define VUNTRUNCATE(vp) vn_flagclr(vp, VTRUNCATED)
286
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288 * Dealing with bad inodes
289 */
Nathan Scott67fcaa72006-06-09 17:00:52 +1000290static inline void vn_mark_bad(struct bhv_vnode *vp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291{
Nathan Scottec86dc02006-03-17 17:25:36 +1100292 make_bad_inode(vn_to_inode(vp));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293}
294
Nathan Scott67fcaa72006-06-09 17:00:52 +1000295static inline int VN_BAD(struct bhv_vnode *vp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296{
Nathan Scottec86dc02006-03-17 17:25:36 +1100297 return is_bad_inode(vn_to_inode(vp));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298}
299
300/*
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100301 * Extracting atime values in various formats
302 */
Nathan Scott67fcaa72006-06-09 17:00:52 +1000303static inline void vn_atime_to_bstime(bhv_vnode_t *vp, xfs_bstime_t *bs_atime)
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100304{
305 bs_atime->tv_sec = vp->v_inode.i_atime.tv_sec;
306 bs_atime->tv_nsec = vp->v_inode.i_atime.tv_nsec;
307}
308
Nathan Scott67fcaa72006-06-09 17:00:52 +1000309static inline void vn_atime_to_timespec(bhv_vnode_t *vp, struct timespec *ts)
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100310{
311 *ts = vp->v_inode.i_atime;
312}
313
Nathan Scott67fcaa72006-06-09 17:00:52 +1000314static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100315{
316 *tt = vp->v_inode.i_atime.tv_sec;
317}
318
319/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320 * Some useful predicates.
321 */
Nathan Scottec86dc02006-03-17 17:25:36 +1100322#define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping)
323#define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages)
324#define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325 PAGECACHE_TAG_DIRTY)
Nathan Scott7d4fb402006-06-09 15:27:16 +1000326#define VN_TRUNC(vp) ((vp)->v_flag & VTRUNCATED)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327
328/*
Nathan Scott67fcaa72006-06-09 17:00:52 +1000329 * Flags to vop_setattr/getattr.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330 */
331#define ATTR_UTIME 0x01 /* non-default utime(2) request */
332#define ATTR_DMI 0x08 /* invocation from a DMI function */
333#define ATTR_LAZY 0x80 /* set/get attributes lazily */
334#define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */
Dean Roehrich5fcbab32005-05-05 13:27:19 -0700335#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */
Eric Sandeen1f730e32005-11-02 15:08:10 +1100336#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337
338/*
Nathan Scott67fcaa72006-06-09 17:00:52 +1000339 * Flags to vop_fsync/reclaim.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 */
341#define FSYNC_NOWAIT 0 /* asynchronous flush */
342#define FSYNC_WAIT 0x1 /* synchronous fsync or forced reclaim */
343#define FSYNC_INVAL 0x2 /* flush and invalidate cached data */
344#define FSYNC_DATA 0x4 /* synchronous fsync of data only */
345
346/*
347 * Tracking vnode activity.
348 */
349#if defined(XFS_VNODE_TRACE)
350
351#define VNODE_TRACE_SIZE 16 /* number of trace entries */
352#define VNODE_KTRACE_ENTRY 1
353#define VNODE_KTRACE_EXIT 2
354#define VNODE_KTRACE_HOLD 3
355#define VNODE_KTRACE_REF 4
356#define VNODE_KTRACE_RELE 5
357
Nathan Scott67fcaa72006-06-09 17:00:52 +1000358extern void vn_trace_entry(struct bhv_vnode *, const char *, inst_t *);
359extern void vn_trace_exit(struct bhv_vnode *, const char *, inst_t *);
360extern void vn_trace_hold(struct bhv_vnode *, char *, int, inst_t *);
361extern void vn_trace_ref(struct bhv_vnode *, char *, int, inst_t *);
362extern void vn_trace_rele(struct bhv_vnode *, char *, int, inst_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363
364#define VN_TRACE(vp) \
365 vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address)
366#else
367#define vn_trace_entry(a,b,c)
368#define vn_trace_exit(a,b,c)
369#define vn_trace_hold(a,b,c,d)
370#define vn_trace_ref(a,b,c,d)
371#define vn_trace_rele(a,b,c,d)
372#define VN_TRACE(vp)
373#endif
374
375#endif /* __XFS_VNODE_H__ */