xref: /netbsd/sys/sys/vnode.h (revision bf9ec67e)
1 /*	$NetBSD: vnode.h,v 1.94 2002/01/09 00:18:02 deberg Exp $	*/
2 
3 /*
4  * Copyright (c) 1989, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *	This product includes software developed by the University of
18  *	California, Berkeley and its contributors.
19  * 4. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *	@(#)vnode.h	8.17 (Berkeley) 5/20/95
36  */
37 
38 #ifndef _SYS_VNODE_H_
39 #define	_SYS_VNODE_H_
40 
41 #include <sys/lock.h>
42 #include <sys/queue.h>
43 
44 /* XXX: clean up includes later */
45 #include <uvm/uvm_param.h>	/* XXX */
46 #include <uvm/uvm_pglist.h>	/* XXX */
47 #include <uvm/uvm_object.h>	/* XXX */
48 #include <uvm/uvm_extern.h>	/* XXX */
49 
50 /*
51  * The vnode is the focus of all file activity in UNIX.  There is a
52  * unique vnode allocated for each active file, each current directory,
53  * each mounted-on file, text file, and the root.
54  */
55 
56 /*
57  * Vnode types.  VNON means no type.
58  */
59 enum vtype	{ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
60 
61 /*
62  * Vnode tag types.
63  * These are for the benefit of external programs only (e.g., pstat)
64  * and should NEVER be inspected by the kernel.
65  */
66 enum vtagtype	{
67 	VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_MSDOSFS, VT_LFS, VT_LOFS, VT_FDESC,
68 	VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS,
69 	VT_UNION, VT_ADOSFS, VT_EXT2FS, VT_CODA, VT_FILECORE, VT_NTFS, VT_VFS,
70 	VT_OVERLAY, VT_SMBFS
71 };
72 
73 /*
74  * Each underlying filesystem allocates its own private area and hangs
75  * it from v_data.  If non-null, this area is freed in getnewvnode().
76  */
77 LIST_HEAD(buflists, buf);
78 
79 /*
80  * Reading or writing any of these items requires holding the appropriate lock.
81  * v_freelist is locked by the global vnode_free_list simple lock.
82  * v_mntvnodes is locked by the global mntvnodes simple lock.
83  * v_flag, v_usecount, v_holdcount and v_writecount are
84  *     locked by the v_interlock simple lock
85  */
86 struct vnode {
87 	struct uvm_object v_uobj;		/* the VM object */
88 #define	v_usecount	v_uobj.uo_refs
89 #define	v_interlock	v_uobj.vmobjlock
90 	voff_t		v_size;			/* size of file */
91 	int		v_flag;			/* flags */
92 	int		v_numoutput;		/* number of pending writes */
93 	long		v_writecount;		/* reference count of writers */
94 	long		v_holdcnt;		/* page & buffer references */
95 	u_long		v_id;			/* capability identifier */
96 	struct mount	*v_mount;		/* ptr to vfs we are in */
97 	int		(**v_op) __P((void *));	/* vnode operations vector */
98 	TAILQ_ENTRY(vnode) v_freelist;		/* vnode freelist */
99 	LIST_ENTRY(vnode) v_mntvnodes;		/* vnodes for mount point */
100 	struct buflists	v_cleanblkhd;		/* clean blocklist head */
101 	struct buflists	v_dirtyblkhd;		/* dirty blocklist head */
102 	LIST_ENTRY(vnode) v_synclist;		/* vnodes with dirty buffers */
103 	union {
104 		struct mount	*vu_mountedhere;/* ptr to mounted vfs (VDIR) */
105 		struct socket	*vu_socket;	/* unix ipc (VSOCK) */
106 		struct specinfo	*vu_specinfo;	/* device (VCHR, VBLK) */
107 		struct fifoinfo	*vu_fifoinfo;	/* fifo (VFIFO) */
108 	} v_un;
109 	struct nqlease	*v_lease;		/* Soft reference to lease */
110 	enum vtype	v_type;			/* vnode type */
111 	enum vtagtype	v_tag;			/* type of underlying data */
112 	struct lock	v_lock;			/* lock for this vnode */
113 	struct lock	*v_vnlock;		/* pointer to lock */
114 	void 		*v_data;		/* private data for fs */
115 };
116 #define	v_mountedhere	v_un.vu_mountedhere
117 #define	v_socket	v_un.vu_socket
118 #define	v_specinfo	v_un.vu_specinfo
119 #define	v_fifoinfo	v_un.vu_fifoinfo
120 /*
121  * All vnode locking operations should use vp->v_vnlock. For leaf filesystems
122  * (such as ffs, lfs, msdosfs, etc), vp->v_vnlock = &vp->v_lock. For
123  * stacked filesystems, vp->v_vnlock may equal lowervp->v_vnlock.
124  *
125  * vp->v_vnlock may also be NULL, which indicates that a leaf node does not
126  * export a struct lock for vnode locking. Stacked filesystems (such as
127  * nullfs) must call the underlying fs for locking. See layerfs_ routines
128  * for examples.
129  *
130  * All filesystems must (pretend to) understand lockmanager flags.
131  */
132 
133 /*
134  * Vnode flags.
135  */
136 #define	VROOT		0x0001	/* root of its file system */
137 #define	VTEXT		0x0002	/* vnode is a pure text prototype */
138 	/* VSYSTEM only used to skip vflush()ing quota files */
139 #define	VSYSTEM		0x0004	/* vnode being used by kernel */
140 	/* VISTTY used when reading dead vnodes */
141 #define	VISTTY		0x0008	/* vnode represents a tty */
142 #define	VEXECMAP	0x0010	/* vnode has PROT_EXEC mappings */
143 #define	VXLOCK		0x0100	/* vnode is locked to change underlying type */
144 #define	VXWANT		0x0200	/* process is waiting for vnode */
145 #define	VBWAIT		0x0400	/* waiting for output to complete */
146 #define	VALIASED	0x0800	/* vnode has an alias */
147 #define	VDIROP		0x1000	/* LFS: vnode is involved in a directory op */
148 #define	VLAYER		0x2000	/* vnode is on a layer filesystem */
149 #define	VONWORKLST	0x4000	/* On syncer work-list */
150 #define	VDIRTY		0x8000	/* vnode possibly has dirty pages */
151 
152 #define	VSIZENOTSET	((voff_t)-1)
153 
154 /*
155  * Vnode attributes.  A field value of VNOVAL represents a field whose value
156  * is unavailable (getattr) or which is not to be changed (setattr).
157  */
158 struct vattr {
159 	enum vtype	va_type;	/* vnode type (for create) */
160 	mode_t		va_mode;	/* files access mode and type */
161 	nlink_t		va_nlink;	/* number of references to file */
162 	uid_t		va_uid;		/* owner user id */
163 	gid_t		va_gid;		/* owner group id */
164 	long		va_fsid;	/* file system id (dev for now) */
165 	long		va_fileid;	/* file id */
166 	u_quad_t	va_size;	/* file size in bytes */
167 	long		va_blocksize;	/* blocksize preferred for i/o */
168 	struct timespec	va_atime;	/* time of last access */
169 	struct timespec	va_mtime;	/* time of last modification */
170 	struct timespec	va_ctime;	/* time file changed */
171 	u_long		va_gen;		/* generation number of file */
172 	u_long		va_flags;	/* flags defined for file */
173 	dev_t		va_rdev;	/* device the special file represents */
174 	u_quad_t	va_bytes;	/* bytes of disk space held by file */
175 	u_quad_t	va_filerev;	/* file modification number */
176 	u_int		va_vaflags;	/* operations flags, see below */
177 	long		va_spare;	/* remain quad aligned */
178 };
179 
180 /*
181  * Flags for va_vaflags.
182  */
183 #define	VA_UTIMES_NULL	0x01		/* utimes argument was NULL */
184 #define	VA_EXCLUSIVE	0x02		/* exclusive create request */
185 
186 /*
187  * Flags for ioflag.
188  */
189 #define	IO_UNIT		0x01		/* do I/O as atomic unit */
190 #define	IO_APPEND	0x02		/* append write to end */
191 #define	IO_SYNC		(0x04|IO_DSYNC)	/* sync I/O file integrity completion */
192 #define	IO_NODELOCKED	0x08		/* underlying node already locked */
193 #define	IO_NDELAY	0x10		/* FNDELAY flag set in file table */
194 #define	IO_DSYNC	0x20		/* sync I/O data integrity completion */
195 #define	IO_ALTSEMANTICS	0x40		/* use alternate i/o semantics */
196 
197 /*
198  *  Modes.
199  */
200 #define	VREAD	00004		/* read, write, execute permissions */
201 #define	VWRITE	00002
202 #define	VEXEC	00001
203 
204 /*
205  * Token indicating no attribute value yet assigned.
206  */
207 #define	VNOVAL	(-1)
208 
209 #ifdef _KERNEL
210 /*
211  * Convert between vnode types and inode formats (since POSIX.1
212  * defines mode word of stat structure in terms of inode formats).
213  */
214 extern enum vtype	iftovt_tab[];
215 extern const int	vttoif_tab[];
216 #define	IFTOVT(mode)	(iftovt_tab[((mode) & S_IFMT) >> 12])
217 #define	VTTOIF(indx)	(vttoif_tab[(int)(indx)])
218 #define	MAKEIMODE(indx, mode)	(int)(VTTOIF(indx) | (mode))
219 
220 /*
221  * Flags to various vnode functions.
222  */
223 #define	SKIPSYSTEM	0x0001		/* vflush: skip vnodes marked VSYSTEM */
224 #define	FORCECLOSE	0x0002		/* vflush: force file closeure */
225 #define	WRITECLOSE	0x0004		/* vflush: only close writeable files */
226 #define	DOCLOSE		0x0008		/* vclean: close active files */
227 #define	V_SAVE		0x0001		/* vinvalbuf: sync file first */
228 
229 /*
230  * Flags to various vnode operations.
231  */
232 #define	REVOKEALL	0x0001		/* revoke: revoke all aliases */
233 
234 #define	FSYNC_WAIT	0x0001		/* fsync: wait for completion */
235 #define	FSYNC_DATAONLY	0x0002		/* fsync: hint: sync file data only */
236 #define	FSYNC_RECLAIM	0x0004		/* fsync: hint: vnode is being reclaimed */
237 #define	FSYNC_LAZY	0x0008		/* fsync: lazy sync (trickle) */
238 
239 #define	UPDATE_WAIT	0x0001		/* update: wait for completion */
240 #define	UPDATE_DIROP	0x0002		/* update: hint to fs to wait or not */
241 
242 #define	HOLDRELE(vp)	holdrele(vp)
243 #define	VHOLD(vp)	vhold(vp)
244 #define	VREF(vp)	vref(vp)
245 TAILQ_HEAD(freelst, vnode);
246 extern struct freelst	vnode_hold_list; /* free vnodes referencing buffers */
247 extern struct freelst	vnode_free_list; /* vnode free list */
248 extern struct simplelock vnode_free_list_slock;
249 
250 #ifdef DIAGNOSTIC
251 #define	ilstatic
252 #else
253 #define	ilstatic static
254 #endif
255 
256 ilstatic void holdrele(struct vnode *);
257 ilstatic void vhold(struct vnode *);
258 ilstatic void vref(struct vnode *);
259 
260 #ifdef DIAGNOSTIC
261 #define	VATTR_NULL(vap)	vattr_null(vap)
262 #else
263 #define	VATTR_NULL(vap)	(*(vap) = va_null)	/* initialize a vattr */
264 
265 /*
266  * decrease buf or page ref
267  */
268 static __inline void
269 holdrele(struct vnode *vp)
270 {
271 
272 	simple_lock(&vp->v_interlock);
273 	vp->v_holdcnt--;
274 	if ((vp->v_freelist.tqe_prev != (struct vnode **)0xdeadb) &&
275 	    vp->v_holdcnt == 0 && vp->v_usecount == 0) {
276 		simple_lock(&vnode_free_list_slock);
277 		TAILQ_REMOVE(&vnode_hold_list, vp, v_freelist);
278 		TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist);
279 		simple_unlock(&vnode_free_list_slock);
280 	}
281 	simple_unlock(&vp->v_interlock);
282 }
283 
284 /*
285  * increase buf or page ref
286  */
287 static __inline void
288 vhold(struct vnode *vp)
289 {
290 
291 	simple_lock(&vp->v_interlock);
292 	if ((vp->v_freelist.tqe_prev != (struct vnode **)0xdeadb) &&
293 	    vp->v_holdcnt == 0 && vp->v_usecount == 0) {
294 		simple_lock(&vnode_free_list_slock);
295 		TAILQ_REMOVE(&vnode_free_list, vp, v_freelist);
296 		TAILQ_INSERT_TAIL(&vnode_hold_list, vp, v_freelist);
297 		simple_unlock(&vnode_free_list_slock);
298 	}
299 	vp->v_holdcnt++;
300 	simple_unlock(&vp->v_interlock);
301 }
302 
303 /*
304  * increase reference
305  */
306 static __inline void
307 vref(struct vnode *vp)
308 {
309 
310 	simple_lock(&vp->v_interlock);
311 	vp->v_usecount++;
312 	simple_unlock(&vp->v_interlock);
313 }
314 #endif /* DIAGNOSTIC */
315 
316 #define	NULLVP	((struct vnode *)NULL)
317 
318 /*
319  * Global vnode data.
320  */
321 extern struct vnode	*rootvnode;	/* root (i.e. "/") vnode */
322 extern int		desiredvnodes;	/* number of vnodes desired */
323 extern long		numvnodes;	/* current number of vnodes */
324 extern time_t		syncdelay;	/* max time to delay syncing data */
325 extern time_t		filedelay;	/* time to delay syncing files */
326 extern time_t		dirdelay;	/* time to delay syncing directories */
327 extern time_t		metadelay;	/* time to delay syncing metadata */
328 extern struct vattr	va_null;	/* predefined null vattr structure */
329 
330 /*
331  * Macro/function to check for client cache inconsistency w.r.t. leasing.
332  */
333 #define	LEASE_READ	0x1		/* Check lease for readers */
334 #define	LEASE_WRITE	0x2		/* Check lease for modifiers */
335 
336 #endif /* _KERNEL */
337 
338 
339 /*
340  * Mods for exensibility.
341  */
342 
343 /*
344  * Flags for vdesc_flags:
345  */
346 #define	VDESC_MAX_VPS		8
347 /* Low order 16 flag bits are reserved for willrele flags for vp arguments. */
348 #define	VDESC_VP0_WILLRELE	0x00000001
349 #define	VDESC_VP1_WILLRELE	0x00000002
350 #define	VDESC_VP2_WILLRELE	0x00000004
351 #define	VDESC_VP3_WILLRELE	0x00000008
352 #define	VDESC_VP0_WILLUNLOCK	0x00000100
353 #define	VDESC_VP1_WILLUNLOCK	0x00000200
354 #define	VDESC_VP2_WILLUNLOCK	0x00000400
355 #define	VDESC_VP3_WILLUNLOCK	0x00000800
356 #define	VDESC_VP0_WILLPUT	0x00000101
357 #define	VDESC_VP1_WILLPUT	0x00000202
358 #define	VDESC_VP2_WILLPUT	0x00000404
359 #define	VDESC_VP3_WILLPUT	0x00000808
360 #define	VDESC_NOMAP_VPP		0x00010000
361 #define	VDESC_VPP_WILLRELE	0x00020000
362 
363 /*
364  * VDESC_NO_OFFSET is used to identify the end of the offset list
365  * and in places where no such field exists.
366  */
367 #define	VDESC_NO_OFFSET -1
368 
369 /*
370  * This structure describes the vnode operation taking place.
371  */
372 struct vnodeop_desc {
373 	int		vdesc_offset;	/* offset in vector--first for speed */
374 	const char	*vdesc_name;	/* a readable name for debugging */
375 	int		vdesc_flags;	/* VDESC_* flags */
376 
377 	/*
378 	 * These ops are used by bypass routines to map and locate arguments.
379 	 * Creds and procs are not needed in bypass routines, but sometimes
380 	 * they are useful to (for example) transport layers.
381 	 * Nameidata is useful because it has a cred in it.
382 	 */
383 	const int	*vdesc_vp_offsets;	/* list ended by VDESC_NO_OFFSET */
384 	int		vdesc_vpp_offset;	/* return vpp location */
385 	int		vdesc_cred_offset;	/* cred location, if any */
386 	int		vdesc_proc_offset;	/* proc location, if any */
387 	int		vdesc_componentname_offset; /* if any */
388 	/*
389 	 * Finally, we've got a list of private data (about each operation)
390 	 * for each transport layer.  (Support to manage this list is not
391 	 * yet part of BSD.)
392 	 */
393 	caddr_t		*vdesc_transports;
394 };
395 
396 #ifdef _KERNEL
397 /*
398  * A list of all the operation descs.
399  */
400 extern struct vnodeop_desc	*vnodeop_descs[];
401 
402 /*
403  * Interlock for scanning list of vnodes attached to a mountpoint
404  */
405 extern struct simplelock	mntvnode_slock;
406 
407 /*
408  * This macro is very helpful in defining those offsets in the vdesc struct.
409  *
410  * This is stolen from X11R4.  I ingored all the fancy stuff for
411  * Crays, so if you decide to port this to such a serious machine,
412  * you might want to consult Intrisics.h's XtOffset{,Of,To}.
413  */
414 #define	VOPARG_OFFSET(p_type,field) \
415 	((int) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
416 #define	VOPARG_OFFSETOF(s_type,field) \
417 	VOPARG_OFFSET(s_type*,field)
418 #define	VOPARG_OFFSETTO(S_TYPE,S_OFFSET,STRUCT_P) \
419 	((S_TYPE)(((char*)(STRUCT_P))+(S_OFFSET)))
420 
421 
422 /*
423  * This structure is used to configure the new vnodeops vector.
424  */
425 struct vnodeopv_entry_desc {
426 	const struct vnodeop_desc *opve_op;	/* which operation this is */
427 	int (*opve_impl)(void *);	/* code implementing this operation */
428 };
429 struct vnodeopv_desc {
430 			/* ptr to the ptr to the vector where op should go */
431 	int (***opv_desc_vector_p)(void *);
432 	const struct vnodeopv_entry_desc *opv_desc_ops; /* null terminated list */
433 };
434 
435 /*
436  * A default routine which just returns an error.
437  */
438 int vn_default_error(void *);
439 
440 /*
441  * A generic structure.
442  * This can be used by bypass routines to identify generic arguments.
443  */
444 struct vop_generic_args {
445 	struct vnodeop_desc *a_desc;
446 	/* other random data follows, presumably */
447 };
448 
449 /*
450  * VOCALL calls an op given an ops vector.  We break it out because BSD's
451  * vclean changes the ops vector and then wants to call ops with the old
452  * vector.
453  */
454 /*
455  * actually, vclean doesn't use it anymore, but nfs does,
456  * for device specials and fifos.
457  */
458 #define	VOCALL(OPSV,OFF,AP) (( *((OPSV)[(OFF)])) (AP))
459 
460 /*
461  * This call works for vnodes in the kernel.
462  */
463 #define	VCALL(VP,OFF,AP) VOCALL((VP)->v_op,(OFF),(AP))
464 #define	VDESC(OP) (& __CONCAT(OP,_desc))
465 #define	VOFFSET(OP) (VDESC(OP)->vdesc_offset)
466 
467 /*
468  * Finally, include the default set of vnode operations.
469  */
470 #include <sys/vnode_if.h>
471 
472 /*
473  * Public vnode manipulation functions.
474  */
475 struct file;
476 struct filedesc;
477 struct mount;
478 struct nameidata;
479 struct proc;
480 struct stat;
481 struct ucred;
482 struct uio;
483 struct vattr;
484 struct vnode;
485 
486 int 	bdevvp(dev_t dev, struct vnode **vpp);
487 int 	cdevvp(dev_t dev, struct vnode **vpp);
488 int 	getnewvnode(enum vtagtype tag, struct mount *mp,
489 			 int (**vops)(void *), struct vnode **vpp);
490 void	ungetnewvnode(struct vnode *);
491 int	getvnode(struct filedesc *fdp, int fd, struct file **fpp);
492 void	vfs_getnewfsid(struct mount *);
493 int	speedup_syncer(void);
494 void 	vattr_null(struct vattr *vap);
495 int 	vcount(struct vnode *vp);
496 void	vclean(struct vnode *, int, struct proc *);
497 int	vfinddev(dev_t, enum vtype, struct vnode **);
498 void	vflushbuf(struct vnode *vp, int sync);
499 int	vflush(struct mount *mp, struct vnode *vp, int flags);
500 void	vntblinit(void);
501 void	vwakeup(struct buf *);
502 void	vdevgone(int, int, int, enum vtype);
503 int 	vget(struct vnode *vp, int lockflag);
504 void 	vgone(struct vnode *vp);
505 void	vgonel(struct vnode *vp, struct proc *p);
506 int	vinvalbuf(struct vnode *vp, int save, struct ucred *cred,
507 	    struct proc *p, int slpflag, int slptimeo);
508 int	vtruncbuf(struct vnode *vp, daddr_t lbn,
509 	    int slpflag, int slptimeo);
510 void	vprint(char *label, struct vnode *vp);
511 int	vrecycle(struct vnode *vp, struct simplelock *inter_lkp,
512 	    struct proc *p);
513 int	vn_bwrite(void *ap);
514 int 	vn_close(struct vnode *vp,
515 	    int flags, struct ucred *cred, struct proc *p);
516 int 	vn_closefile(struct file *fp, struct proc *p);
517 int	vn_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p);
518 int	vn_fcntl(struct file *fp, u_int com, caddr_t data, struct proc *p);
519 int	vn_lock(struct vnode *vp, int flags);
520 u_int	vn_setrecurse(struct vnode *vp);
521 void	vn_restorerecurse(struct vnode *vp, u_int flags);
522 int 	vn_open(struct nameidata *ndp, int fmode, int cmode);
523 int 	vn_rdwr(enum uio_rw rw, struct vnode *vp, caddr_t base,
524 	    int len, off_t offset, enum uio_seg segflg, int ioflg,
525 	    struct ucred *cred, size_t *aresid, struct proc *p);
526 int	vn_read(struct file *fp, off_t *offset, struct uio *uio,
527 	    struct ucred *cred, int flags);
528 int	vn_readdir(struct file *fp, char *buf, int segflg, u_int count,
529 	    int *done, struct proc *p, off_t **cookies, int *ncookies);
530 int	vn_poll(struct file *fp, int events, struct proc *p);
531 int	vn_stat(void *fdata, struct stat *sb, struct proc *p);
532 void	vn_syncer_add_to_worklist(struct vnode *vp, int delay);
533 void	vn_syncer_remove_from_worklist(struct vnode *vp);
534 int	vn_write(struct file *fp, off_t *offset, struct uio *uio,
535 	    struct ucred *cred, int flags);
536 int	vn_writechk(struct vnode *vp);
537 void	vn_markexec(struct vnode *vp);
538 int	vn_isunder(struct vnode *dvp, struct vnode *rvp, struct proc *p);
539 struct vnode *
540 	checkalias(struct vnode *vp, dev_t nvp_rdev, struct mount *mp);
541 void 	vput(struct vnode *vp);
542 void 	vrele(struct vnode *vp);
543 int	vaccess(enum vtype type, mode_t file_mode, uid_t uid, gid_t gid,
544 		     mode_t acc_mode, struct ucred *cred);
545 #ifdef DDB
546 void	vfs_vnode_print(struct vnode *, int, void (*)(const char *, ...));
547 #endif /* DDB */
548 #endif /* _KERNEL */
549 
550 #endif /* !_SYS_VNODE_H_ */
551