vnode_if.src revision 29353
11541Srgrimes#
21541Srgrimes# Copyright (c) 1992, 1993
31541Srgrimes#	The Regents of the University of California.  All rights reserved.
41541Srgrimes#
51541Srgrimes# Redistribution and use in source and binary forms, with or without
61541Srgrimes# modification, are permitted provided that the following conditions
71541Srgrimes# are met:
81541Srgrimes# 1. Redistributions of source code must retain the above copyright
91541Srgrimes#    notice, this list of conditions and the following disclaimer.
101541Srgrimes# 2. Redistributions in binary form must reproduce the above copyright
111541Srgrimes#    notice, this list of conditions and the following disclaimer in the
121541Srgrimes#    documentation and/or other materials provided with the distribution.
131541Srgrimes# 3. All advertising materials mentioning features or use of this software
141541Srgrimes#    must display the following acknowledgement:
151541Srgrimes#	This product includes software developed by the University of
161541Srgrimes#	California, Berkeley and its contributors.
171541Srgrimes# 4. Neither the name of the University nor the names of its contributors
181541Srgrimes#    may be used to endorse or promote products derived from this software
191541Srgrimes#    without specific prior written permission.
201541Srgrimes#
211541Srgrimes# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221541Srgrimes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231541Srgrimes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241541Srgrimes# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251541Srgrimes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261541Srgrimes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271541Srgrimes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281541Srgrimes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291541Srgrimes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301541Srgrimes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311541Srgrimes# SUCH DAMAGE.
321541Srgrimes#
3322521Sdyson#	@(#)vnode_if.src	8.12 (Berkeley) 5/14/95
3429353Speter# $Id: vnode_if.src,v 1.12 1997/08/25 20:28:49 phk Exp $
351541Srgrimes#
3622521Sdyson
3722521Sdyson#
3822521Sdyson# Above each of the vop descriptors is a specification of the locking
3922521Sdyson# protocol used by each vop call.  The first column is the name of
4022521Sdyson# the variable, the remaining three columns are in, out and error
4122521Sdyson# respectively.  The "in" column defines the lock state on input,
4222521Sdyson# the "out" column defines the state on succesful return, and the
4322521Sdyson# "error" column defines the locking state on error exit.
4422521Sdyson#
4522521Sdyson# The locking value can take the following values:
4622521Sdyson# L: locked.
4722521Sdyson# U: unlocked/
4822521Sdyson# -: not applicable.  vnode does not yet (or no longer) exists.
4922521Sdyson# =: the same on input and output, may be either L or U.
5022521Sdyson# X: locked if not nil.
5122521Sdyson#
5222521Sdyson
5322521Sdyson#
5422521Sdyson#% lookup	dvp	L ? ?
5522521Sdyson#% lookup	vpp	- L -
5622521Sdyson#
5722521Sdyson# XXX - the lookup locking protocol defies simple description and depends
5822521Sdyson#	on the flags and operation fields in the (cnp) structure.  Note
5922521Sdyson#	especially that *vpp may equal dvp and both may be locked.
6022521Sdyson#
611541Srgrimesvop_lookup {
621541Srgrimes	IN struct vnode *dvp;
631541Srgrimes	INOUT struct vnode **vpp;
641541Srgrimes	IN struct componentname *cnp;
651541Srgrimes};
661541Srgrimes
6722521Sdyson#
6828732Sphk#% cachedlookup	dvp	L ? ?
6928732Sphk#% cachedlookup	vpp	- L -
7028732Sphk#
7128732Sphk# This must be an exact copy of lookup.  See kern/vfs_cache.c for details.
7228732Sphk#
7328732Sphkvop_cachedlookup {
7428732Sphk	IN struct vnode *dvp;
7528732Sphk	INOUT struct vnode **vpp;
7628732Sphk	IN struct componentname *cnp;
7728732Sphk};
7828732Sphk
7928732Sphk#
8022521Sdyson#% create	dvp	L U U
8122521Sdyson#% create	vpp	- L -
8222521Sdyson#
831541Srgrimesvop_create {
841541Srgrimes	IN WILLRELE struct vnode *dvp;
851541Srgrimes	OUT struct vnode **vpp;
861541Srgrimes	IN struct componentname *cnp;
871541Srgrimes	IN struct vattr *vap;
881541Srgrimes};
891541Srgrimes
9022521Sdyson#
9122521Sdyson#% whiteout	dvp	L L L
9222521Sdyson#% whiteout	cnp	- - -
9322521Sdyson#% whiteout	flag	- - -
9422521Sdyson#
9522521Sdysonvop_whiteout {
9622521Sdyson	IN WILLRELE struct vnode *dvp;
9722521Sdyson	IN struct componentname *cnp;
9822521Sdyson	IN int flags;
9922521Sdyson};
10022521Sdyson
10122521Sdyson#
10222521Sdyson#% mknod	dvp	L U U
10322521Sdyson#% mknod	vpp	- X -
10422521Sdyson#
1051541Srgrimesvop_mknod {
1061541Srgrimes	IN WILLRELE struct vnode *dvp;
1071541Srgrimes	OUT WILLRELE struct vnode **vpp;
1081541Srgrimes	IN struct componentname *cnp;
1091541Srgrimes	IN struct vattr *vap;
1101541Srgrimes};
1111541Srgrimes
11222521Sdyson#
11322521Sdyson#% open		vp	L L L
11422521Sdyson#
1151541Srgrimesvop_open {
1161541Srgrimes	IN struct vnode *vp;
1171541Srgrimes	IN int mode;
1181541Srgrimes	IN struct ucred *cred;
1191541Srgrimes	IN struct proc *p;
1201541Srgrimes};
1211541Srgrimes
12222521Sdyson#
12322521Sdyson#% close	vp	U U U
12422521Sdyson#
1251541Srgrimesvop_close {
1261541Srgrimes	IN struct vnode *vp;
1271541Srgrimes	IN int fflag;
1281541Srgrimes	IN struct ucred *cred;
1291541Srgrimes	IN struct proc *p;
1301541Srgrimes};
1311541Srgrimes
13222521Sdyson#
13322521Sdyson#% access	vp	L L L
13422521Sdyson#
1351541Srgrimesvop_access {
1361541Srgrimes	IN struct vnode *vp;
1371541Srgrimes	IN int mode;
1381541Srgrimes	IN struct ucred *cred;
1391541Srgrimes	IN struct proc *p;
1401541Srgrimes};
1411541Srgrimes
14222521Sdyson#
14322521Sdyson#% getattr	vp	= = =
14422521Sdyson#
1451541Srgrimesvop_getattr {
1461541Srgrimes	IN struct vnode *vp;
1471541Srgrimes	IN struct vattr *vap;
1481541Srgrimes	IN struct ucred *cred;
1491541Srgrimes	IN struct proc *p;
1501541Srgrimes};
1511541Srgrimes
15222521Sdyson#
15322521Sdyson#% setattr	vp	L L L
15422521Sdyson#
1551541Srgrimesvop_setattr {
1561541Srgrimes	IN struct vnode *vp;
1571541Srgrimes	IN struct vattr *vap;
1581541Srgrimes	IN struct ucred *cred;
1591541Srgrimes	IN struct proc *p;
1601541Srgrimes};
1611541Srgrimes
16222521Sdyson#
16322521Sdyson#% read		vp	L L L
16422521Sdyson#
1651541Srgrimesvop_read {
1661541Srgrimes	IN struct vnode *vp;
1671541Srgrimes	INOUT struct uio *uio;
1681541Srgrimes	IN int ioflag;
1691541Srgrimes	IN struct ucred *cred;
1701541Srgrimes};
1711541Srgrimes
17222521Sdyson#
17322521Sdyson#% write	vp	L L L
17422521Sdyson#
1751541Srgrimesvop_write {
1761541Srgrimes	IN struct vnode *vp;
1771541Srgrimes	INOUT struct uio *uio;
1781541Srgrimes	IN int ioflag;
1791541Srgrimes	IN struct ucred *cred;
1801541Srgrimes};
1811541Srgrimes
18222521Sdyson#
18322521Sdyson#% lease	vp	= = =
18422521Sdyson#
18522521Sdysonvop_lease {
18622521Sdyson	IN struct vnode *vp;
18722521Sdyson	IN struct proc *p;
18822521Sdyson	IN struct ucred *cred;
18922521Sdyson	IN int flag;
19022521Sdyson};
19122521Sdyson
19222521Sdyson#
19322521Sdyson#% ioctl	vp	U U U
19422521Sdyson#
1951541Srgrimesvop_ioctl {
1961541Srgrimes	IN struct vnode *vp;
19722521Sdyson	IN u_long command;
1981541Srgrimes	IN caddr_t data;
1991541Srgrimes	IN int fflag;
2001541Srgrimes	IN struct ucred *cred;
2011541Srgrimes	IN struct proc *p;
2021541Srgrimes};
2031541Srgrimes
20422521Sdyson#
20529353Speter#% poll	vp	U U U
20622521Sdyson#
20729353Spetervop_poll {
2081541Srgrimes	IN struct vnode *vp;
20929353Speter	IN int events;
2101541Srgrimes	IN struct ucred *cred;
2111541Srgrimes	IN struct proc *p;
2121541Srgrimes};
2131541Srgrimes
21422521Sdyson#
21522521Sdyson#% revoke	vp	U U U
21622521Sdyson#
21722521Sdysonvop_revoke {
21822521Sdyson	IN struct vnode *vp;
21922521Sdyson	IN int flags;
22022521Sdyson};
22122521Sdyson
22222521Sdyson#
22322521Sdyson# XXX - not used
22422521Sdyson#
2251541Srgrimesvop_mmap {
2261541Srgrimes	IN struct vnode *vp;
2271541Srgrimes	IN int fflags;
2281541Srgrimes	IN struct ucred *cred;
2291541Srgrimes	IN struct proc *p;
2301541Srgrimes};
2311541Srgrimes
23222521Sdyson#
23322521Sdyson#% fsync	vp	L L L
23422521Sdyson#
2351541Srgrimesvop_fsync {
2361541Srgrimes	IN struct vnode *vp;
2371541Srgrimes	IN struct ucred *cred;
2381541Srgrimes	IN int waitfor;
2391541Srgrimes	IN struct proc *p;
2401541Srgrimes};
2411541Srgrimes
24222521Sdyson#
24322521Sdyson# XXX - not used
24422521Sdyson# Needs work: Is newoff right?  What's it mean?
24522521Sdyson#
2461541Srgrimesvop_seek {
2471541Srgrimes	IN struct vnode *vp;
2481541Srgrimes	IN off_t oldoff;
2491541Srgrimes	IN off_t newoff;
2501541Srgrimes	IN struct ucred *cred;
2511541Srgrimes};
2521541Srgrimes
25322521Sdyson#
25422521Sdyson#% remove	dvp	L U U
25522521Sdyson#% remove	vp	L U U
25622521Sdyson#
2571541Srgrimesvop_remove {
2581541Srgrimes	IN WILLRELE struct vnode *dvp;
2591541Srgrimes	IN WILLRELE struct vnode *vp;
2601541Srgrimes	IN struct componentname *cnp;
2611541Srgrimes};
2621541Srgrimes
26322521Sdyson#
26422521Sdyson#% link		vp	U U U
26522521Sdyson#% link		tdvp	L U U
26622521Sdyson#
2679842Sdgvop_link {
2689842Sdg	IN WILLRELE struct vnode *tdvp;
2699842Sdg	IN struct vnode *vp;
2709842Sdg	IN struct componentname *cnp;
2719842Sdg};
2721541Srgrimes
27322521Sdyson#
27422521Sdyson#% rename	fdvp	U U U
27522521Sdyson#% rename	fvp	U U U
27622521Sdyson#% rename	tdvp	L U U
27722521Sdyson#% rename	tvp	X U U
27822521Sdyson#
2791541Srgrimesvop_rename {
2801541Srgrimes	IN WILLRELE struct vnode *fdvp;
2811541Srgrimes	IN WILLRELE struct vnode *fvp;
2821541Srgrimes	IN struct componentname *fcnp;
2831541Srgrimes	IN WILLRELE struct vnode *tdvp;
2841541Srgrimes	IN WILLRELE struct vnode *tvp;
2851541Srgrimes	IN struct componentname *tcnp;
2861541Srgrimes};
2871541Srgrimes
28822521Sdyson#
28922521Sdyson#% mkdir	dvp	L U U
29022521Sdyson#% mkdir	vpp	- L -
29122521Sdyson#
2921541Srgrimesvop_mkdir {
2931541Srgrimes	IN WILLRELE struct vnode *dvp;
2941541Srgrimes	OUT struct vnode **vpp;
2951541Srgrimes	IN struct componentname *cnp;
2961541Srgrimes	IN struct vattr *vap;
2971541Srgrimes};
2981541Srgrimes
29922521Sdyson#
30022521Sdyson#% rmdir	dvp	L U U
30122521Sdyson#% rmdir	vp	L U U
30222521Sdyson#
3031541Srgrimesvop_rmdir {
3041541Srgrimes	IN WILLRELE struct vnode *dvp;
3051541Srgrimes	IN WILLRELE struct vnode *vp;
3061541Srgrimes	IN struct componentname *cnp;
3071541Srgrimes};
3081541Srgrimes
30922521Sdyson#
31022521Sdyson#% symlink	dvp	L U U
31122521Sdyson#% symlink	vpp	- U -
31222521Sdyson#
31322521Sdyson# XXX - note that the return vnode has already been VRELE'ed
31422521Sdyson#	by the filesystem layer.  To use it you must use vget,
31522521Sdyson#	possibly with a further namei.
31622521Sdyson#
3171541Srgrimesvop_symlink {
3181541Srgrimes	IN WILLRELE struct vnode *dvp;
3191541Srgrimes	OUT WILLRELE struct vnode **vpp;
3201541Srgrimes	IN struct componentname *cnp;
3211541Srgrimes	IN struct vattr *vap;
3221541Srgrimes	IN char *target;
3231541Srgrimes};
3241541Srgrimes
32522521Sdyson#
32622521Sdyson#% readdir	vp	L L L
32722521Sdyson#
3281541Srgrimesvop_readdir {
3291541Srgrimes	IN struct vnode *vp;
3301541Srgrimes	INOUT struct uio *uio;
3311541Srgrimes	IN struct ucred *cred;
3323167Sdfr	INOUT int *eofflag;
33322521Sdyson	OUT int *ncookies;
33422521Sdyson	INOUT u_long **cookies;
3351541Srgrimes};
3361541Srgrimes
33722521Sdyson#
33822521Sdyson#% readlink	vp	L L L
33922521Sdyson#
3401541Srgrimesvop_readlink {
3411541Srgrimes	IN struct vnode *vp;
3421541Srgrimes	INOUT struct uio *uio;
3431541Srgrimes	IN struct ucred *cred;
3441541Srgrimes};
3451541Srgrimes
34622521Sdyson#
34722521Sdyson#% abortop	dvp	= = =
34822521Sdyson#
3491541Srgrimesvop_abortop {
3501541Srgrimes	IN struct vnode *dvp;
3511541Srgrimes	IN struct componentname *cnp;
3521541Srgrimes};
3531541Srgrimes
35422521Sdyson#
35522521Sdyson#% inactive	vp	L U U
35622521Sdyson#
3571541Srgrimesvop_inactive {
3581541Srgrimes	IN struct vnode *vp;
35922521Sdyson	IN struct proc *p;
3601541Srgrimes};
3611541Srgrimes
36222521Sdyson#
36322521Sdyson#% reclaim	vp	U U U
36422521Sdyson#
3651541Srgrimesvop_reclaim {
3661541Srgrimes	IN struct vnode *vp;
36722521Sdyson	IN struct proc *p;
3681541Srgrimes};
3691541Srgrimes
37022521Sdyson#
37122521Sdyson#% lock		vp	U L U
37222521Sdyson#
3731541Srgrimesvop_lock {
3741541Srgrimes	IN struct vnode *vp;
37522521Sdyson	IN int flags;
37622521Sdyson	IN struct proc *p;
3771541Srgrimes};
3781541Srgrimes
37922521Sdyson#
38022521Sdyson#% unlock	vp	L U L
38122521Sdyson#
3821541Srgrimesvop_unlock {
3831541Srgrimes	IN struct vnode *vp;
38422521Sdyson	IN int flags;
38522521Sdyson	IN struct proc *p;
3861541Srgrimes};
3871541Srgrimes
38822521Sdyson#
38922521Sdyson#% bmap		vp	L L L
39022521Sdyson#% bmap		vpp	- U -
39122521Sdyson#
3921541Srgrimesvop_bmap {
3931541Srgrimes	IN struct vnode *vp;
3941541Srgrimes	IN daddr_t bn;
3951541Srgrimes	OUT struct vnode **vpp;
3961541Srgrimes	IN daddr_t *bnp;
3971541Srgrimes	OUT int *runp;
39810551Sdyson	OUT int *runb;
3991541Srgrimes};
4001541Srgrimes
40122521Sdyson#
40222521Sdyson# Needs work: no vp?
40322521Sdyson#
4041541Srgrimes#vop_strategy {
4051541Srgrimes#	IN struct buf *bp;
4061541Srgrimes#};
4071541Srgrimes
40822521Sdyson#
40922521Sdyson#% print	vp	= = =
41022521Sdyson#
4111541Srgrimesvop_print {
4121541Srgrimes	IN struct vnode *vp;
4131541Srgrimes};
4141541Srgrimes
41522521Sdyson#
41622521Sdyson#% islocked	vp	= = =
41722521Sdyson#
4181541Srgrimesvop_islocked {
4191541Srgrimes	IN struct vnode *vp;
4201541Srgrimes};
4211541Srgrimes
42222521Sdyson#
42322521Sdyson#% pathconf	vp	L L L
42422521Sdyson#
4251541Srgrimesvop_pathconf {
4261541Srgrimes	IN struct vnode *vp;
4271541Srgrimes	IN int name;
42822521Sdyson	OUT register_t *retval;
4291541Srgrimes};
4301541Srgrimes
43122521Sdyson#
43222521Sdyson#% advlock	vp	U U U
43322521Sdyson#
4341541Srgrimesvop_advlock {
4351541Srgrimes	IN struct vnode *vp;
4361541Srgrimes	IN caddr_t id;
4371541Srgrimes	IN int op;
4381541Srgrimes	IN struct flock *fl;
4391541Srgrimes	IN int flags;
4401541Srgrimes};
4411541Srgrimes
44222521Sdyson#
44322521Sdyson#% blkatoff	vp	L L L
44422521Sdyson#
4451541Srgrimesvop_blkatoff {
4461541Srgrimes	IN struct vnode *vp;
4471541Srgrimes	IN off_t offset;
4481541Srgrimes	OUT char **res;
4491541Srgrimes	OUT struct buf **bpp;
4501541Srgrimes};
4511541Srgrimes
45222521Sdyson#
45322521Sdyson#% valloc	pvp	L L L
45422521Sdyson#
4551541Srgrimesvop_valloc {
4561541Srgrimes	IN struct vnode *pvp;
4571541Srgrimes	IN int mode;
4581541Srgrimes	IN struct ucred *cred;
4591541Srgrimes	OUT struct vnode **vpp;
4601541Srgrimes};
4611541Srgrimes
46222521Sdyson#
46322521Sdyson#% reallocblks	vp	L L L
46422521Sdyson#
4651541Srgrimesvop_reallocblks {
4661541Srgrimes	IN struct vnode *vp;
4671541Srgrimes	IN struct cluster_save *buflist;
4681541Srgrimes};
4691541Srgrimes
47022521Sdyson#
47122521Sdyson#% vfree	pvp	L L L
47222521Sdyson#
4731541Srgrimesvop_vfree {
4741541Srgrimes	IN struct vnode *pvp;
4751541Srgrimes	IN ino_t ino;
4761541Srgrimes	IN int mode;
4771541Srgrimes};
4781541Srgrimes
47922521Sdyson#
48022521Sdyson#% truncate	vp	L L L
48122521Sdyson#
4821541Srgrimesvop_truncate {
4831541Srgrimes	IN struct vnode *vp;
4841541Srgrimes	IN off_t length;
4851541Srgrimes	IN int flags;
4861541Srgrimes	IN struct ucred *cred;
4871541Srgrimes	IN struct proc *p;
4881541Srgrimes};
4891541Srgrimes
49022521Sdyson#
49122521Sdyson#% update	vp	L L L
49222521Sdyson#
4931541Srgrimesvop_update {
4941541Srgrimes	IN struct vnode *vp;
4951541Srgrimes	IN struct timeval *access;
4961541Srgrimes	IN struct timeval *modify;
4971541Srgrimes	IN int waitfor;
4981541Srgrimes};
4991541Srgrimes
50010551Sdysonvop_getpages {
50110551Sdyson	IN struct vnode *vp;
50210551Sdyson	IN vm_page_t *m;
50310551Sdyson	IN int count;
50410551Sdyson	IN int reqpage;
50512767Sdyson	IN vm_ooffset_t offset;
50610551Sdyson};
50710551Sdyson
50810551Sdysonvop_putpages {
50910551Sdyson	IN struct vnode *vp;
51010551Sdyson	IN vm_page_t *m;
51110551Sdyson	IN int count;
51210551Sdyson	IN int sync;
51310551Sdyson	IN int *rtvals;
51412767Sdyson	IN vm_ooffset_t offset;
51510551Sdyson};
51611704Sdyson
51722521Sdyson#
5181541Srgrimes# Needs work: no vp?
51922521Sdyson#
5201541Srgrimes#vop_bwrite {
5211541Srgrimes#	IN struct buf *bp;
5221541Srgrimes#};
523