1/*	$OpenBSD: vnode.h,v 1.170 2024/02/03 18:51:58 beck Exp $	*/
2/*	$NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $	*/
3
4/*
5 * Copyright (c) 1989, 1993
6 *	The Regents of the University of California.  All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 *    may be used to endorse or promote products derived from this software
18 *    without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 *	@(#)vnode.h	8.11 (Berkeley) 11/21/94
33 */
34
35#ifndef _SYS_VNODE_H_
36#define _SYS_VNODE_H_
37
38#include <sys/buf.h>
39#include <sys/types.h>
40#include <sys/event.h>
41#include <sys/queue.h>
42#include <sys/tree.h>
43
44/*
45 * The vnode is the focus of all file activity in UNIX.  There is a
46 * unique vnode allocated for each active file, each current directory,
47 * each mounted-on file, text file, and the root.
48 */
49
50/*
51 * Vnode types.  VNON means no type.
52 */
53enum vtype	{ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
54
55#define	VTYPE_NAMES \
56    "VNON", "VREG", "VDIR", "VBLK", "VCHR", "VLNK", "VSOCK", "VFIFO", "VBAD"
57
58/*
59 * Vnode tag types.
60 * These are for the benefit of external programs only (e.g., pstat)
61 * and should NEVER be inspected by the kernel.
62 *
63 * Note that v_tag is actually used to tell MFS from FFS, and EXT2FS from
64 * the rest, so don't believe the above comment!
65 */
66enum vtagtype	{
67	VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_MSDOSFS,
68	VT_PORTAL, VT_PROCFS, VT_AFS, VT_ISOFS, VT_ADOSFS,
69	VT_EXT2FS, VT_VFS, VT_NTFS, VT_UDF, VT_FUSEFS, VT_TMPFS,
70};
71
72#define	VTAG_NAMES \
73    "NON", "UFS", "NFS", "MFS", "MSDOSFS",			\
74    "unused", "unused", "unused", "ISOFS", "unused",		\
75    "EXT2FS", "VFS", "NTFS", "UDF", "FUSEFS", "TMPFS"
76
77/*
78 * Each underlying filesystem allocates its own private area and hangs
79 * it from v_data.  If non-null, this area is freed in getnewvnode().
80 */
81LIST_HEAD(buflists, buf);
82
83RBT_HEAD(buf_rb_bufs, buf);
84
85struct namecache;
86RBT_HEAD(namecache_rb_cache, namecache);
87
88/*
89 * Locks used to protect struct members in struct vnode:
90 *	a	atomic
91 *	V	vnode_mtx
92 *	B	IPL_BIO
93 */
94struct uvm_vnode;
95struct vnode {
96	struct uvm_vnode *v_uvm;	/* uvm data */
97	const struct vops *v_op;	/* vnode operations vector */
98	enum	vtype v_type;		/* vnode type */
99	enum	vtagtype v_tag;		/* type of underlying data */
100	u_int	v_flag;			/* vnode flags (see below) */
101	u_int	v_lflag;		/* [V] lock vnode flags */
102	u_int   v_usecount;		/* reference count of users */
103	u_int   v_uvcount;		/* unveil references */
104	u_int   v_writecount;		/* reference count of writers */
105	u_int	v_lockcount;		/* [V] # threads waiting on lock */
106
107	u_int   v_bioflag;		/* [B] flags accessed in interrupts */
108	u_int   v_holdcnt;		/* [B] buffer references */
109	u_int   v_id;				/* capability identifier */
110	struct	mount *v_mount;			/* ptr to vfs we are in */
111	TAILQ_ENTRY(vnode) v_freelist;	/* [B] vnode freelist */
112	TAILQ_ENTRY(vnode) v_mntvnodes;		/* vnodes for mount point */
113	struct	buf_rb_bufs v_bufs_tree;/* [B] lookup of all bufs */
114	struct	buflists v_cleanblkhd;	/* [B] clean blocklist head */
115	struct	buflists v_dirtyblkhd;	/* [B] dirty blocklist head */
116	u_int   v_numoutput;		/* [B] num of writes in progress */
117	LIST_ENTRY(vnode) v_synclist;	/* [B] vnode with dirty buffers */
118	union {
119		struct mount	*vu_mountedhere;/* ptr to mounted vfs (VDIR) */
120		struct socket	*vu_socket;	/* unix ipc (VSOCK) */
121		struct specinfo	*vu_specinfo;	/* device (VCHR, VBLK) */
122		struct fifoinfo	*vu_fifoinfo;	/* fifo (VFIFO) */
123	} v_un;
124
125	/* VFS namecache */
126	struct namecache_rb_cache v_nc_tree;
127	TAILQ_HEAD(, namecache) v_cache_dst;	 /* cache entries to us */
128
129	void	*v_data;			/* private data for fs */
130	struct	klist v_klist;			/* identity of poller(s) */
131};
132#define	v_mountedhere	v_un.vu_mountedhere
133#define	v_socket	v_un.vu_socket
134#define	v_specinfo	v_un.vu_specinfo
135#define	v_fifoinfo	v_un.vu_fifoinfo
136
137/*
138 * Vnode flags.
139 */
140#define	VROOT		0x0001	/* root of its file system */
141#define	VTEXT		0x0002	/* vnode is a pure text prototype */
142#define	VSYSTEM		0x0004	/* vnode being used by kernel */
143#define	VISTTY		0x0008	/* vnode represents a tty */
144#define	VXLOCK		0x0100	/* vnode is locked to change underlying type */
145#define	VXWANT		0x0200	/* process is waiting for vnode */
146#define	VCLONED		0x0400	/* vnode was cloned */
147#define	VALIASED	0x0800	/* vnode has an alias */
148#define	VLARVAL		0x1000	/* vnode data not yet set up by higher level */
149#define	VLOCKSWORK	0x4000	/* FS supports locking discipline */
150#define	VCLONE		0x8000	/* vnode is a clone */
151
152/*
153 * (v_bioflag) Flags that may be manipulated by interrupt handlers
154 */
155#define	VBIOWAIT	0x0001	/* waiting for output to complete */
156#define VBIOONSYNCLIST	0x0002	/* Vnode is on syncer worklist */
157#define VBIOONFREELIST  0x0004  /* Vnode is on a free list */
158#define VBIOERROR	0x0008  /* A write failed */
159
160/*
161 * Vnode attributes.  A field value of VNOVAL represents a field whose value
162 * is unavailable (getattr) or which is not to be changed (setattr).  For
163 * the timespec fields, only the tv_nsec member needs to be set to VNOVAL:
164 * if tv_nsec != VNOVAL then both tv_sec and tv_nsec are valid.
165 */
166struct vattr {
167	enum vtype	va_type;	/* vnode type (for create) */
168	mode_t		va_mode;	/* files access mode and type */
169	nlink_t		va_nlink;	/* number of references to file */
170	uid_t		va_uid;		/* owner user id */
171	gid_t		va_gid;		/* owner group id */
172	long		va_fsid;	/* file system id (dev for now) */
173	u_quad_t	va_fileid;	/* file id */
174	u_quad_t	va_size;	/* file size in bytes */
175	long		va_blocksize;	/* blocksize preferred for i/o */
176	struct timespec	va_atime;	/* time of last access */
177	struct timespec	va_mtime;	/* time of last modification */
178	struct timespec	va_ctime;	/* time file changed */
179	u_long		va_gen;		/* generation number of file */
180	u_long		va_flags;	/* flags defined for file */
181	dev_t		va_rdev;	/* device the special file represents */
182	u_quad_t	va_bytes;	/* bytes of disk space held by file */
183	u_quad_t	va_filerev;	/* file modification number */
184	u_int		va_vaflags;	/* operations flags, see below */
185	long		va_spare;	/* remain quad aligned */
186};
187
188/*
189 * Flags for va_vaflags.
190 */
191#define	VA_UTIMES_NULL		0x01	/* utimes argument was NULL */
192#define	VA_EXCLUSIVE		0x02	/* exclusive create request */
193#define	VA_UTIMES_CHANGE	0x04	/* ctime should be updated */
194/*
195 * Flags for ioflag.
196 */
197#define	IO_UNIT		0x01		/* do I/O as atomic unit */
198#define	IO_APPEND	0x02		/* append write to end */
199#define	IO_SYNC		0x04		/* do I/O synchronously */
200#define	IO_NODELOCKED	0x08		/* underlying node already locked */
201#define	IO_NDELAY	0x10		/* FNDELAY flag set in file table */
202#define	IO_NOLIMIT	0x20		/* don't enforce limits on i/o */
203#define	IO_NOCACHE	0x40		/* don't cache result of this i/o */
204
205/*
206 *  Modes.  Some values same as Ixxx entries from inode.h for now.
207 */
208#define	VSUID	04000		/* set user id on execution */
209#define	VSGID	02000		/* set group id on execution */
210#define	VSVTX	01000		/* save swapped text even after use */
211#define	VREAD	00400		/* read, write, execute permissions */
212#define	VWRITE	00200
213#define	VEXEC	00100
214
215/*
216 * Token indicating no attribute value yet assigned.
217 */
218#define	VNOVAL	(-1)
219
220#ifdef _KERNEL
221RBT_PROTOTYPE(buf_rb_bufs, buf, b_rbbufs, rb_buf_compare);
222/*
223 * Convert between vnode types and inode formats (since POSIX.1
224 * defines mode word of stat structure in terms of inode formats).
225 */
226extern enum vtype	iftovt_tab[];
227extern int		vttoif_tab[];
228#define IFTOVT(mode)	(iftovt_tab[((mode) & S_IFMT) >> 12])
229#define VTTOIF(indx)	(vttoif_tab[(int)(indx)])
230#define MAKEIMODE(indx, mode)	(int)(VTTOIF(indx) | (mode))
231
232/*
233 * Flags to various vnode functions.
234 */
235#define	SKIPSYSTEM	0x0001		/* vflush: skip vnodes marked VSYSTEM */
236#define	FORCECLOSE	0x0002		/* vflush: force file closeure */
237#define	WRITECLOSE	0x0004		/* vflush: only close writeable files */
238#define	DOCLOSE		0x0008		/* vclean: close active files */
239#define	IGNORECLEAN	0x0010		/* vflush: ignore clean vnodes */
240#define	V_SAVE		0x0001		/* vinvalbuf: sync file first */
241#define	V_SAVEMETA	0x0002		/* vinvalbuf: leave indirect blocks */
242
243#define REVOKEALL	0x0001		/* vop_revoke: revoke all aliases */
244
245
246#define	VATTR_NULL(vap)	vattr_null(vap)
247#define	NULLVP	((struct vnode *)NULL)
248#define	VN_KNOTE(vp, b)					\
249	knote_locked(&vp->v_klist, (b))
250
251/*
252 * Global vnode data.
253 */
254extern	struct vnode *rootvnode;	/* root (i.e. "/") vnode */
255extern	int initialvnodes;		/* XXX number of vnodes to start */
256extern	int maxvnodes;			/* XXX number of vnodes to allocate */
257extern	int syncdelay;			/* seconds to delay syncing vnodes */
258extern	int rushjob;			/* # of slots syncer should run ASAP */
259extern	struct mutex vnode_mtx;
260extern void    vhold(struct vnode *);
261extern void    vdrop(struct vnode *);
262
263/* vnode operations */
264struct vops {
265	int	(*vop_lock)(void *);
266	int	(*vop_unlock)(void *);
267	int	(*vop_islocked)(void *);
268	int	(*vop_abortop)(void *);
269	int	(*vop_access)(void *);
270	int	(*vop_advlock)(void *);
271	int	(*vop_bmap)(void *);
272	int	(*vop_bwrite)(void *);
273	int	(*vop_close)(void *);
274	int	(*vop_create)(void *);
275	int	(*vop_fsync)(void *);
276	int	(*vop_getattr)(void *);
277	int	(*vop_inactive)(void *);
278	int	(*vop_ioctl)(void *);
279	int	(*vop_link)(void *);
280	int	(*vop_lookup)(void *);
281	int	(*vop_mknod)(void *);
282	int	(*vop_open)(void *);
283	int	(*vop_pathconf)(void *);
284	int	(*vop_print)(void *);
285	int	(*vop_read)(void *);
286	int	(*vop_readdir)(void *);
287	int	(*vop_readlink)(void *);
288	int	(*vop_reclaim)(void *);
289	int	(*vop_remove)(void *);
290	int	(*vop_rename)(void *);
291	int	(*vop_revoke)(void *);
292	int	(*vop_mkdir)(void *);
293	int	(*vop_rmdir)(void *);
294	int	(*vop_setattr)(void *);
295	int	(*vop_strategy)(void *);
296	int	(*vop_symlink)(void *);
297	int	(*vop_write)(void *);
298	int	(*vop_kqfilter)(void *);
299};
300
301extern const struct vops dead_vops;
302extern const struct vops spec_vops;
303
304struct vop_generic_args {
305	void		*a_garbage;
306	/* Other data probably follows; */
307};
308
309struct vop_islocked_args {
310	struct vnode *a_vp;
311};
312int VOP_ISLOCKED(struct vnode *);
313
314struct vop_lookup_args {
315	struct vnode *a_dvp;
316	struct vnode **a_vpp;
317	struct componentname *a_cnp;
318};
319int VOP_LOOKUP(struct vnode *, struct vnode **, struct componentname *);
320
321struct vop_create_args {
322	struct vnode *a_dvp;
323	struct vnode **a_vpp;
324	struct componentname *a_cnp;
325	struct vattr *a_vap;
326};
327int VOP_CREATE(struct vnode *, struct vnode **, struct componentname *,
328    struct vattr *);
329
330struct vop_mknod_args {
331	struct vnode *a_dvp;
332	struct vnode **a_vpp;
333	struct componentname *a_cnp;
334	struct vattr *a_vap;
335};
336int VOP_MKNOD(struct vnode *, struct vnode **, struct componentname *,
337    struct vattr *);
338
339struct vop_open_args {
340	struct vnode *a_vp;
341	int a_mode;
342	struct ucred *a_cred;
343	struct proc *a_p;
344};
345int VOP_OPEN(struct vnode *, int, struct ucred *, struct proc *);
346
347struct vop_close_args {
348	struct vnode *a_vp;
349	int a_fflag;
350	struct ucred *a_cred;
351	struct proc *a_p;
352};
353int VOP_CLOSE(struct vnode *, int, struct ucred *, struct proc *);
354
355struct vop_access_args {
356	struct vnode *a_vp;
357	int a_mode;
358	struct ucred *a_cred;
359	struct proc *a_p;
360};
361int VOP_ACCESS(struct vnode *, int, struct ucred *, struct proc *);
362
363struct vop_getattr_args {
364	struct vnode *a_vp;
365	struct vattr *a_vap;
366	struct ucred *a_cred;
367	struct proc *a_p;
368};
369int VOP_GETATTR(struct vnode *, struct vattr *, struct ucred *, struct proc *);
370
371struct vop_setattr_args {
372	struct vnode *a_vp;
373	struct vattr *a_vap;
374	struct ucred *a_cred;
375	struct proc *a_p;
376};
377int VOP_SETATTR(struct vnode *, struct vattr *, struct ucred *, struct proc *);
378
379struct vop_read_args {
380	struct vnode *a_vp;
381	struct uio *a_uio;
382	int a_ioflag;
383	struct ucred *a_cred;
384};
385int VOP_READ(struct vnode *, struct uio *, int, struct ucred *);
386
387struct vop_write_args {
388	struct vnode *a_vp;
389	struct uio *a_uio;
390	int a_ioflag;
391	struct ucred *a_cred;
392};
393int VOP_WRITE(struct vnode *, struct uio *, int, struct ucred *);
394
395struct vop_ioctl_args {
396	struct vnode *a_vp;
397	u_long a_command;
398	void *a_data;
399	int a_fflag;
400	struct ucred *a_cred;
401	struct proc *a_p;
402};
403int VOP_IOCTL(struct vnode *, u_long, void *, int, struct ucred *,
404    struct proc *);
405
406struct vop_kqfilter_args {
407	struct vnode *a_vp;
408	int a_fflag;
409	struct knote *a_kn;
410};
411int VOP_KQFILTER(struct vnode *, int, struct knote *);
412
413struct vop_revoke_args {
414	struct vnode *a_vp;
415	int a_flags;
416};
417int VOP_REVOKE(struct vnode *, int);
418
419struct vop_fsync_args {
420	struct vnode *a_vp;
421	struct ucred *a_cred;
422	int a_waitfor;
423	struct proc *a_p;
424};
425int VOP_FSYNC(struct vnode *, struct ucred *, int, struct proc *);
426
427struct vop_remove_args {
428	struct vnode *a_dvp;
429	struct vnode *a_vp;
430	struct componentname *a_cnp;
431};
432int VOP_REMOVE(struct vnode *, struct vnode *, struct componentname *);
433
434struct vop_link_args {
435	struct vnode *a_dvp;
436	struct vnode *a_vp;
437	struct componentname *a_cnp;
438};
439int VOP_LINK(struct vnode *, struct vnode *, struct componentname *);
440
441struct vop_rename_args {
442	struct vnode *a_fdvp;
443	struct vnode *a_fvp;
444	struct componentname *a_fcnp;
445	struct vnode *a_tdvp;
446	struct vnode *a_tvp;
447	struct componentname *a_tcnp;
448};
449int VOP_RENAME(struct vnode *, struct vnode *, struct componentname *,
450    struct vnode *, struct vnode *, struct componentname *);
451
452struct vop_mkdir_args {
453	struct vnode *a_dvp;
454	struct vnode **a_vpp;
455	struct componentname *a_cnp;
456	struct vattr *a_vap;
457};
458int VOP_MKDIR(struct vnode *, struct vnode **, struct componentname *,
459    struct vattr *);
460
461struct vop_rmdir_args {
462	struct vnode *a_dvp;
463	struct vnode *a_vp;
464	struct componentname *a_cnp;
465};
466int VOP_RMDIR(struct vnode *, struct vnode *, struct componentname *);
467
468struct vop_symlink_args {
469	struct vnode *a_dvp;
470	struct vnode **a_vpp;
471	struct componentname *a_cnp;
472	struct vattr *a_vap;
473	char *a_target;
474};
475int VOP_SYMLINK(struct vnode *, struct vnode **, struct componentname *,
476    struct vattr *, char *);
477
478struct vop_readdir_args {
479	struct vnode *a_vp;
480	struct uio *a_uio;
481	struct ucred *a_cred;
482	int *a_eofflag;
483};
484int VOP_READDIR(struct vnode *, struct uio *, struct ucred *, int *);
485
486struct vop_readlink_args {
487	struct vnode *a_vp;
488	struct uio *a_uio;
489	struct ucred *a_cred;
490};
491int VOP_READLINK(struct vnode *, struct uio *, struct ucred *);
492
493struct vop_abortop_args {
494	struct vnode *a_dvp;
495	struct componentname *a_cnp;
496};
497int VOP_ABORTOP(struct vnode *, struct componentname *);
498
499struct vop_inactive_args {
500	struct vnode *a_vp;
501	struct proc *a_p;
502};
503int VOP_INACTIVE(struct vnode *, struct proc *);
504
505struct vop_reclaim_args {
506	struct vnode *a_vp;
507	struct proc *a_p;
508};
509int VOP_RECLAIM(struct vnode *, struct proc *);
510
511struct vop_lock_args {
512	struct vnode *a_vp;
513	int a_flags;
514};
515int VOP_LOCK(struct vnode *, int);
516
517struct vop_unlock_args {
518	struct vnode *a_vp;
519};
520int VOP_UNLOCK(struct vnode *);
521
522struct vop_bmap_args {
523	struct vnode *a_vp;
524	daddr_t a_bn;
525	struct vnode **a_vpp;
526	daddr_t *a_bnp;
527	int *a_runp;
528};
529int VOP_BMAP(struct vnode *, daddr_t, struct vnode **, daddr_t *, int *);
530
531struct vop_print_args {
532	struct vnode *a_vp;
533};
534int VOP_PRINT(struct vnode *);
535
536struct vop_pathconf_args {
537	struct vnode *a_vp;
538	int a_name;
539	register_t *a_retval;
540};
541int VOP_PATHCONF(struct vnode *, int, register_t *);
542
543struct vop_advlock_args {
544	struct vnode *a_vp;
545	void *a_id;
546	int a_op;
547	struct flock *a_fl;
548	int a_flags;
549};
550int VOP_ADVLOCK(struct vnode *, void *, int, struct flock *, int);
551
552struct vop_strategy_args {
553	struct vnode *a_vp;
554	struct buf *a_bp;
555};
556int VOP_STRATEGY(struct vnode *, struct buf *);
557
558/* Special cases: */
559struct vop_bwrite_args {
560	struct buf *a_bp;
561};
562int VOP_BWRITE(struct buf *);
563/* End of special cases. */
564
565
566/* Public vnode manipulation functions. */
567struct file;
568struct filedesc;
569struct mount;
570struct nameidata;
571struct proc;
572struct stat;
573struct statfs;
574struct ucred;
575struct uio;
576struct vattr;
577struct vnode;
578
579/* vfs_subr */
580int	bdevvp(dev_t, struct vnode **);
581int	cdevvp(dev_t, struct vnode **);
582struct vnode *checkalias(struct vnode *, dev_t, struct mount *);
583int	getnewvnode(enum vtagtype, struct mount *, const struct vops *,
584	    struct vnode **);
585int	vaccess(enum vtype, mode_t, uid_t, gid_t, mode_t, struct ucred *);
586int	vnoperm(struct vnode *);
587void	vattr_null(struct vattr *);
588void	vdevgone(int, int, int, enum vtype);
589int	vcount(struct vnode *);
590int	vfinddev(dev_t, enum vtype, struct vnode **);
591void	vflushbuf(struct vnode *, int);
592int	vflush(struct mount *, struct vnode *, int);
593int	vget(struct vnode *, int);
594void	vgone(struct vnode *);
595void	vgonel(struct vnode *, struct proc *);
596int	vinvalbuf(struct vnode *, int, struct ucred *, struct proc *,
597	    int, uint64_t);
598void	vntblinit(void);
599int	vwaitforio(struct vnode *, int, char *, uint64_t);
600void	vwakeup(struct vnode *);
601void	vput(struct vnode *);
602int	vrecycle(struct vnode *, struct proc *);
603int	vrele(struct vnode *);
604void	vref(struct vnode *);
605void	vprint(char *, struct vnode *);
606void	copy_statfs_info(struct statfs *, const struct mount *);
607
608/* vfs_getcwd.c */
609#define GETCWD_CHECK_ACCESS 0x0001
610int vfs_getcwd_scandir(struct vnode **, struct vnode **, char **, char *,
611    struct proc *);
612int vfs_getcwd_common(struct vnode *, struct vnode *, char **, char *, int,
613    int, struct proc *);
614int vfs_getcwd_getcache(struct vnode **, struct vnode **, char **, char *);
615
616/* vfs_default.c */
617int	vop_generic_abortop(void *);
618int	vop_generic_badop(void *);
619int	vop_generic_bmap(void *);
620int	vop_generic_bwrite(void *);
621int	vop_generic_revoke(void *);
622int	vop_generic_kqfilter(void *);
623int	vop_generic_lookup(void *);
624
625/* vfs_vnops.c */
626int	vn_isunder(struct vnode *, struct vnode *, struct proc *);
627int	vn_close(struct vnode *, int, struct ucred *, struct proc *);
628int	vn_open(struct nameidata *, int, int);
629int	vn_rdwr(enum uio_rw, struct vnode *, caddr_t, int, off_t,
630	    enum uio_seg, int, struct ucred *, size_t *, struct proc *);
631int	vn_stat(struct vnode *, struct stat *, struct proc *);
632int	vn_statfile(struct file *, struct stat *, struct proc *);
633int	vn_lock(struct vnode *, int);
634int	vn_writechk(struct vnode *);
635int	vn_fsizechk(struct vnode *, struct uio *, int, ssize_t *);
636int	vn_ioctl(struct file *, u_long, caddr_t, struct proc *);
637void	vn_marktext(struct vnode *);
638
639/* vfs_sync.c */
640void	syncer_thread(void *);
641void	vn_initialize_syncerd(void);
642void	vn_syncer_add_to_worklist(struct vnode *, int);
643
644/* misc */
645int	vn_isdisk(struct vnode *, int *);
646int 	getvnode(struct proc *, int, struct file **);
647
648/* uvm */
649void	uvm_vnp_setsize(struct vnode *, off_t);
650void	uvm_vnp_sync(struct mount *);
651void	uvm_vnp_terminate(struct vnode *);
652int	uvm_vnp_uncache(struct vnode *);
653
654
655#endif /* _KERNEL */
656#endif /* _SYS_VNODE_H_ */
657