blob: 0f9ba6585c86b04ef9009f7b9a065ba703ef0d05 [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:
Christoph Hellwig2f6f7b32007-08-29 11:44:18 +100038 * v_flag, 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) */
Nathan Scott8285fb52006-06-09 17:07:12 +100042 bhv_vnumber_t v_number; /* in-core vnode number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
Christoph Hellwig51c91ed2005-09-02 16:58:38 +100044 atomic_t v_iocount; /* outstanding I/O count */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#ifdef XFS_VNODE_TRACE
46 struct ktrace *v_trace; /* trace header structure */
47#endif
Eric Sandeen9effd8e2005-05-05 13:26:18 -070048 struct inode v_inode; /* Linux inode */
49 /* inode MUST be last */
Nathan Scott67fcaa72006-06-09 17:00:52 +100050} bhv_vnode_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Christoph Hellwig0432dab2005-09-02 16:46:51 +100052#define VN_ISLNK(vp) S_ISLNK((vp)->v_inode.i_mode)
53#define VN_ISREG(vp) S_ISREG((vp)->v_inode.i_mode)
54#define VN_ISDIR(vp) S_ISDIR((vp)->v_inode.i_mode)
55#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode)
56#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode)
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058/*
59 * Vnode to Linux inode mapping.
60 */
Nathan Scott67fcaa72006-06-09 17:00:52 +100061static inline struct bhv_vnode *vn_from_inode(struct inode *inode)
Nathan Scottec86dc02006-03-17 17:25:36 +110062{
Alexey Dobriyan71306f32006-06-27 14:10:29 +100063 return container_of(inode, bhv_vnode_t, v_inode);
Nathan Scottec86dc02006-03-17 17:25:36 +110064}
Nathan Scott67fcaa72006-06-09 17:00:52 +100065static inline struct inode *vn_to_inode(struct bhv_vnode *vnode)
Nathan Scottec86dc02006-03-17 17:25:36 +110066{
67 return &vnode->v_inode;
68}
Linus Torvalds1da177e2005-04-16 15:20:36 -070069
70/*
Nathan Scott67fcaa72006-06-09 17:00:52 +100071 * Values for the vop_rwlock/rwunlock flags parameter.
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 */
Nathan Scott8285fb52006-06-09 17:07:12 +100073typedef enum bhv_vrwlock {
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 VRWLOCK_NONE,
75 VRWLOCK_READ,
76 VRWLOCK_WRITE,
77 VRWLOCK_WRITE_DIRECT,
78 VRWLOCK_TRY_READ,
79 VRWLOCK_TRY_WRITE
Nathan Scott8285fb52006-06-09 17:07:12 +100080} bhv_vrwlock_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
82/*
Christoph Hellwig739bfb22007-08-29 10:58:01 +100083 * Return values for xfs_inactive. A return value of
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 * VN_INACTIVE_NOCACHE implies that the file system behavior
85 * has disassociated its state and bhv_desc_t from the vnode.
86 */
87#define VN_INACTIVE_CACHE 0
88#define VN_INACTIVE_NOCACHE 1
89
90/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 * Flags for read/write calls - same values as IRIX
92 */
93#define IO_ISAIO 0x00001 /* don't wait for completion */
94#define IO_ISDIRECT 0x00004 /* bypass page cache */
95#define IO_INVIS 0x00020 /* don't update inode timestamps */
96
97/*
Nathan Scott67fcaa72006-06-09 17:00:52 +100098 * Flags for vop_iflush call
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 */
100#define FLUSH_SYNC 1 /* wait for flush to complete */
101#define FLUSH_INODE 2 /* flush the inode itself */
102#define FLUSH_LOG 4 /* force the last log entry for
103 * this inode out to disk */
104
105/*
Nathan Scott67fcaa72006-06-09 17:00:52 +1000106 * Flush/Invalidate options for vop_toss/flush/flushinval_pages.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107 */
108#define FI_NONE 0 /* none */
109#define FI_REMAPF 1 /* Do a remapf prior to the operation */
110#define FI_REMAPF_LOCKED 2 /* Do a remapf prior to the operation.
111 Prevent VM access to the pages until
112 the operation completes. */
113
114/*
115 * Vnode attributes. va_mask indicates those attributes the caller
116 * wants to set or extract.
117 */
Nathan Scott8285fb52006-06-09 17:07:12 +1000118typedef struct bhv_vattr {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 int va_mask; /* bit-mask of attributes present */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 mode_t va_mode; /* file access mode and type */
Nathan Scott31b084a2005-05-05 13:25:00 -0700121 xfs_nlink_t va_nlink; /* number of references to file */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 uid_t va_uid; /* owner user id */
123 gid_t va_gid; /* owner group id */
124 xfs_ino_t va_nodeid; /* file id */
125 xfs_off_t va_size; /* file size in bytes */
126 u_long va_blocksize; /* blocksize preferred for i/o */
127 struct timespec va_atime; /* time of last access */
128 struct timespec va_mtime; /* time of last modification */
129 struct timespec va_ctime; /* time file changed */
130 u_int va_gen; /* generation number of file */
131 xfs_dev_t va_rdev; /* device the special file represents */
132 __int64_t va_nblocks; /* number of blocks allocated */
133 u_long va_xflags; /* random extended file flags */
134 u_long va_extsize; /* file extent size */
135 u_long va_nextents; /* number of extents in file */
136 u_long va_anextents; /* number of attr extents in file */
Nathan Scottb74e2152005-06-21 13:21:49 +1000137 prid_t va_projid; /* project id */
Nathan Scott8285fb52006-06-09 17:07:12 +1000138} bhv_vattr_t;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
140/*
141 * setattr or getattr attributes
142 */
143#define XFS_AT_TYPE 0x00000001
144#define XFS_AT_MODE 0x00000002
145#define XFS_AT_UID 0x00000004
146#define XFS_AT_GID 0x00000008
147#define XFS_AT_FSID 0x00000010
148#define XFS_AT_NODEID 0x00000020
149#define XFS_AT_NLINK 0x00000040
150#define XFS_AT_SIZE 0x00000080
151#define XFS_AT_ATIME 0x00000100
152#define XFS_AT_MTIME 0x00000200
153#define XFS_AT_CTIME 0x00000400
154#define XFS_AT_RDEV 0x00000800
155#define XFS_AT_BLKSIZE 0x00001000
156#define XFS_AT_NBLOCKS 0x00002000
157#define XFS_AT_VCODE 0x00004000
158#define XFS_AT_MAC 0x00008000
159#define XFS_AT_UPDATIME 0x00010000
160#define XFS_AT_UPDMTIME 0x00020000
161#define XFS_AT_UPDCTIME 0x00040000
162#define XFS_AT_ACL 0x00080000
163#define XFS_AT_CAP 0x00100000
164#define XFS_AT_INF 0x00200000
165#define XFS_AT_XFLAGS 0x00400000
166#define XFS_AT_EXTSIZE 0x00800000
167#define XFS_AT_NEXTENTS 0x01000000
168#define XFS_AT_ANEXTENTS 0x02000000
169#define XFS_AT_PROJID 0x04000000
170#define XFS_AT_SIZE_NOPERM 0x08000000
171#define XFS_AT_GENCOUNT 0x10000000
172
173#define XFS_AT_ALL (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
174 XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
175 XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
176 XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|XFS_AT_MAC|\
177 XFS_AT_ACL|XFS_AT_CAP|XFS_AT_INF|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|\
178 XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT)
179
180#define XFS_AT_STAT (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
181 XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
182 XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\
183 XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_PROJID)
184
185#define XFS_AT_TIMES (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME)
186
187#define XFS_AT_UPDTIMES (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME)
188
189#define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\
190 XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\
191 XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT)
192
193/*
194 * Modes.
195 */
196#define VSUID S_ISUID /* set user id on execution */
197#define VSGID S_ISGID /* set group id on execution */
198#define VSVTX S_ISVTX /* save swapped text even after use */
199#define VREAD S_IRUSR /* read, write, execute permissions */
200#define VWRITE S_IWUSR
201#define VEXEC S_IXUSR
202
203#define MODEMASK S_IALLUGO /* mode bits plus permission bits */
204
205/*
206 * Check whether mandatory file locking is enabled.
207 */
208#define MANDLOCK(vp, mode) \
Christoph Hellwig0432dab2005-09-02 16:46:51 +1000209 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
211extern void vn_init(void);
Nathan Scott67fcaa72006-06-09 17:00:52 +1000212extern bhv_vnode_t *vn_initialize(struct inode *);
213extern int vn_revalidate(struct bhv_vnode *);
Nathan Scott8285fb52006-06-09 17:07:12 +1000214extern int __vn_revalidate(struct bhv_vnode *, bhv_vattr_t *);
215extern void vn_revalidate_core(struct bhv_vnode *, bhv_vattr_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216
Nathan Scott67fcaa72006-06-09 17:00:52 +1000217extern void vn_iowait(struct bhv_vnode *vp);
218extern void vn_iowake(struct bhv_vnode *vp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
Nathan Scott67fcaa72006-06-09 17:00:52 +1000220extern void vn_ioerror(struct bhv_vnode *vp, int error, char *f, int l);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
Nathan Scott67fcaa72006-06-09 17:00:52 +1000222static inline int vn_count(struct bhv_vnode *vp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223{
Nathan Scottec86dc02006-03-17 17:25:36 +1100224 return atomic_read(&vn_to_inode(vp)->i_count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225}
226
227/*
228 * Vnode reference counting functions (and macros for compatibility).
229 */
Nathan Scott67fcaa72006-06-09 17:00:52 +1000230extern bhv_vnode_t *vn_hold(struct bhv_vnode *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
232#if defined(XFS_VNODE_TRACE)
233#define VN_HOLD(vp) \
234 ((void)vn_hold(vp), \
235 vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address))
236#define VN_RELE(vp) \
237 (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \
Nathan Scottec86dc02006-03-17 17:25:36 +1100238 iput(vn_to_inode(vp)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239#else
240#define VN_HOLD(vp) ((void)vn_hold(vp))
Nathan Scottec86dc02006-03-17 17:25:36 +1100241#define VN_RELE(vp) (iput(vn_to_inode(vp)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242#endif
243
Nathan Scott67fcaa72006-06-09 17:00:52 +1000244static inline struct bhv_vnode *vn_grab(struct bhv_vnode *vp)
Christoph Hellwigcdb62682005-09-02 16:24:19 +1000245{
Nathan Scottec86dc02006-03-17 17:25:36 +1100246 struct inode *inode = igrab(vn_to_inode(vp));
247 return inode ? vn_from_inode(inode) : NULL;
Christoph Hellwigcdb62682005-09-02 16:24:19 +1000248}
249
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250/*
251 * Vname handling macros.
252 */
253#define VNAME(dentry) ((char *) (dentry)->d_name.name)
254#define VNAMELEN(dentry) ((dentry)->d_name.len)
Nathan Scottec86dc02006-03-17 17:25:36 +1100255#define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
257/*
258 * Vnode spinlock manipulation.
259 */
260#define VN_LOCK(vp) mutex_spinlock(&(vp)->v_lock)
261#define VN_UNLOCK(vp, s) mutex_spinunlock(&(vp)->v_lock, s)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
David Chinner7989cb82007-02-10 18:34:56 +1100263STATIC_INLINE void vn_flagset(struct bhv_vnode *vp, uint flag)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264{
265 spin_lock(&vp->v_lock);
266 vp->v_flag |= flag;
267 spin_unlock(&vp->v_lock);
268}
269
David Chinner7989cb82007-02-10 18:34:56 +1100270STATIC_INLINE uint vn_flagclr(struct bhv_vnode *vp, uint flag)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271{
Nathan Scott7d4fb402006-06-09 15:27:16 +1000272 uint cleared;
273
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274 spin_lock(&vp->v_lock);
Nathan Scott7d4fb402006-06-09 15:27:16 +1000275 cleared = (vp->v_flag & flag);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 vp->v_flag &= ~flag;
277 spin_unlock(&vp->v_lock);
Nathan Scott7d4fb402006-06-09 15:27:16 +1000278 return cleared;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279}
280
Nathan Scott7d4fb402006-06-09 15:27:16 +1000281#define VMODIFY(vp) vn_flagset(vp, VMODIFIED)
282#define VUNMODIFY(vp) vn_flagclr(vp, VMODIFIED)
283#define VTRUNCATE(vp) vn_flagset(vp, VTRUNCATED)
284#define VUNTRUNCATE(vp) vn_flagclr(vp, VTRUNCATED)
285
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287 * Dealing with bad inodes
288 */
Nathan Scott67fcaa72006-06-09 17:00:52 +1000289static inline void vn_mark_bad(struct bhv_vnode *vp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290{
Nathan Scottec86dc02006-03-17 17:25:36 +1100291 make_bad_inode(vn_to_inode(vp));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292}
293
Nathan Scott67fcaa72006-06-09 17:00:52 +1000294static inline int VN_BAD(struct bhv_vnode *vp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295{
Nathan Scottec86dc02006-03-17 17:25:36 +1100296 return is_bad_inode(vn_to_inode(vp));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297}
298
299/*
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100300 * Extracting atime values in various formats
301 */
Nathan Scott67fcaa72006-06-09 17:00:52 +1000302static inline void vn_atime_to_bstime(bhv_vnode_t *vp, xfs_bstime_t *bs_atime)
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100303{
304 bs_atime->tv_sec = vp->v_inode.i_atime.tv_sec;
305 bs_atime->tv_nsec = vp->v_inode.i_atime.tv_nsec;
306}
307
Nathan Scott67fcaa72006-06-09 17:00:52 +1000308static inline void vn_atime_to_timespec(bhv_vnode_t *vp, struct timespec *ts)
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100309{
310 *ts = vp->v_inode.i_atime;
311}
312
Nathan Scott67fcaa72006-06-09 17:00:52 +1000313static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
Nathan Scottca5ccbf2006-01-11 21:03:04 +1100314{
315 *tt = vp->v_inode.i_atime.tv_sec;
316}
317
318/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 * Some useful predicates.
320 */
Nathan Scottec86dc02006-03-17 17:25:36 +1100321#define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping)
322#define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages)
323#define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324 PAGECACHE_TAG_DIRTY)
Nathan Scott7d4fb402006-06-09 15:27:16 +1000325#define VN_TRUNC(vp) ((vp)->v_flag & VTRUNCATED)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326
327/*
Nathan Scott67fcaa72006-06-09 17:00:52 +1000328 * Flags to vop_setattr/getattr.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329 */
330#define ATTR_UTIME 0x01 /* non-default utime(2) request */
331#define ATTR_DMI 0x08 /* invocation from a DMI function */
332#define ATTR_LAZY 0x80 /* set/get attributes lazily */
333#define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */
Dean Roehrich5fcbab32005-05-05 13:27:19 -0700334#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */
Eric Sandeen1f730e32005-11-02 15:08:10 +1100335#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336
337/*
Nathan Scott67fcaa72006-06-09 17:00:52 +1000338 * Flags to vop_fsync/reclaim.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 */
340#define FSYNC_NOWAIT 0 /* asynchronous flush */
341#define FSYNC_WAIT 0x1 /* synchronous fsync or forced reclaim */
342#define FSYNC_INVAL 0x2 /* flush and invalidate cached data */
343#define FSYNC_DATA 0x4 /* synchronous fsync of data only */
344
345/*
346 * Tracking vnode activity.
347 */
348#if defined(XFS_VNODE_TRACE)
349
350#define VNODE_TRACE_SIZE 16 /* number of trace entries */
351#define VNODE_KTRACE_ENTRY 1
352#define VNODE_KTRACE_EXIT 2
353#define VNODE_KTRACE_HOLD 3
354#define VNODE_KTRACE_REF 4
355#define VNODE_KTRACE_RELE 5
356
Nathan Scott67fcaa72006-06-09 17:00:52 +1000357extern void vn_trace_entry(struct bhv_vnode *, const char *, inst_t *);
358extern void vn_trace_exit(struct bhv_vnode *, const char *, inst_t *);
359extern void vn_trace_hold(struct bhv_vnode *, char *, int, inst_t *);
360extern void vn_trace_ref(struct bhv_vnode *, char *, int, inst_t *);
361extern void vn_trace_rele(struct bhv_vnode *, char *, int, inst_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362
363#define VN_TRACE(vp) \
364 vn_trace_ref(vp, __FILE__, __LINE__, (inst_t *)__return_address)
365#else
366#define vn_trace_entry(a,b,c)
367#define vn_trace_exit(a,b,c)
368#define vn_trace_hold(a,b,c,d)
369#define vn_trace_ref(a,b,c,d)
370#define vn_trace_rele(a,b,c,d)
371#define VN_TRACE(vp)
372#endif
373
374#endif /* __XFS_VNODE_H__ */