1 # $NetBSD: vnode_if.src,v 1.57 2008/01/25 14:32:15 ad Exp $
3 # Copyright (c) 1992, 1993
4 # The Regents of the University of California. All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # 3. All advertising materials mentioning features or use of this software
15 # must display the following acknowledgement:
16 # This product includes software developed by the University of
17 # California, Berkeley and its contributors.
18 # 4. Neither the name of the University nor the names of its contributors
19 # may be used to endorse or promote products derived from this software
20 # without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 # @(#)vnode_if.src 8.14 (Berkeley) 8/6/95
39 # Above each of the vop descriptors is a specification of the locking
40 # protocol used by each vop call. The first column is the name of
41 # the variable, the remaining three columns are in, out and error
42 # respectively. The "in" column defines the lock state on input,
43 # the "out" column defines the state on successful return, and the
44 # "error" column defines the locking state on error exit.
46 # The locking value can take the following values:
49 # -: not applicable. vnode does not yet (or no longer) exists.
50 # =: the same on input and output, may be either L or U.
51 # X: locked if not nil.
53 # For operations other than VOP_LOOKUP which require a component name
54 # parameter, the flags required for the initial namei() call are listed.
55 # Additional flags may be added to the namei() call, but these are required.
62 # XXX - the lookup locking protocol defies simple description.
63 # Note especially that *vpp may equal dvp.
66 # There are three types of lookups: ".", ".." (ISDOTDOT), and other.
67 # On successful lookup of ".", a reference is added to dvp, and it
68 # is returned in *vpp.
69 # To look up ISDOTDOT, dvp is unlocked, the ".." node is locked, and
70 # then dvp is relocked. This preserves the protocol of always
71 # locking nodes from root ("/") downward and prevents deadlock.
72 # Other lookups find the named node (creating the vnode if needed) and
73 # return it, locked, in *vpp.
74 # On failure, *vpp is NULL, and *dvp is left locked.
76 # *vpp is always locked on return if the operation succeeds.
77 # Typically, if *vpp == dvp, you need to release twice, but
80 # See sys/sys/namei.h for a description of the SAVENAME and SAVESTART
85 OUT WILLMAKE struct vnode **vpp;
86 IN struct componentname *cnp;
93 #! create cnp CREATE, LOCKPARENT
96 IN LOCKED=YES WILLPUT struct vnode *dvp;
97 OUT WILLMAKE struct vnode **vpp;
98 IN struct componentname *cnp;
106 #! mknod cnp CREATE, LOCKPARENT
109 IN LOCKED=YES WILLPUT struct vnode *dvp;
110 OUT WILLMAKE struct vnode **vpp;
111 IN struct componentname *cnp;
112 IN struct vattr *vap;
119 IN LOCKED=YES struct vnode *vp;
121 IN kauth_cred_t cred;
128 IN LOCKED=YES struct vnode *vp;
130 IN kauth_cred_t cred;
137 IN LOCKED=YES struct vnode *vp;
139 IN kauth_cred_t cred;
147 IN struct vattr *vap;
148 IN kauth_cred_t cred;
155 IN LOCKED=YES struct vnode *vp;
156 IN struct vattr *vap;
157 IN kauth_cred_t cred;
164 IN LOCKED=YES struct vnode *vp;
165 INOUT struct uio *uio;
167 IN kauth_cred_t cred;
174 IN LOCKED=YES struct vnode *vp;
175 INOUT struct uio *uio;
177 IN kauth_cred_t cred;
184 IN LOCKED=NO struct vnode *vp;
188 IN kauth_cred_t cred;
195 IN LOCKED=NO struct vnode *vp;
199 IN kauth_cred_t cred;
206 IN LOCKED=NO struct vnode *vp;
214 IN LOCKED=NO struct vnode *vp;
222 IN LOCKED=NO struct vnode *vp;
232 IN kauth_cred_t cred;
239 IN LOCKED=YES struct vnode *vp;
240 IN kauth_cred_t cred;
247 # Needs work: Is newoff right? What's it mean?
248 # XXX Locking protocol?
254 IN kauth_cred_t cred;
261 #! remove cnp DELETE, LOCKPARENT | LOCKLEAF
264 IN LOCKED=YES WILLPUT struct vnode *dvp;
265 IN LOCKED=YES WILLPUT struct vnode *vp;
266 IN struct componentname *cnp;
273 #! link cnp CREATE, LOCKPARENT
276 IN LOCKED=YES WILLPUT struct vnode *dvp;
277 IN LOCKED=NO struct vnode *vp;
278 IN struct componentname *cnp;
287 #! rename fcnp DELETE, LOCKPARENT | SAVESTART
288 #! rename tcnp RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART
290 # XXX the vop_rename routines should REALLY NOT be depending on SAVESTART!
293 IN LOCKED=NO WILLRELE struct vnode *fdvp;
294 IN LOCKED=NO WILLRELE struct vnode *fvp;
295 IN struct componentname *fcnp;
296 IN LOCKED=YES WILLPUT struct vnode *tdvp;
297 IN WILLPUT struct vnode *tvp;
298 IN struct componentname *tcnp;
305 #! mkdir cnp CREATE, LOCKPARENT
308 IN LOCKED=YES WILLPUT struct vnode *dvp;
309 OUT WILLMAKE struct vnode **vpp;
310 IN struct componentname *cnp;
311 IN struct vattr *vap;
318 #! rmdir cnp DELETE, LOCKPARENT | LOCKLEAF
321 IN LOCKED=YES WILLPUT struct vnode *dvp;
322 IN LOCKED=YES WILLPUT struct vnode *vp;
323 IN struct componentname *cnp;
330 #! symlink cnp CREATE, LOCKPARENT
333 IN LOCKED=YES WILLPUT struct vnode *dvp;
334 OUT WILLMAKE struct vnode **vpp;
335 IN struct componentname *cnp;
336 IN struct vattr *vap;
344 IN LOCKED=YES struct vnode *vp;
345 INOUT struct uio *uio;
346 IN kauth_cred_t cred;
356 IN LOCKED=YES struct vnode *vp;
357 INOUT struct uio *uio;
358 IN kauth_cred_t cred;
364 #! abortop cnp as appropriate.
367 IN struct vnode *dvp;
368 IN struct componentname *cnp;
375 IN LOCKED=YES WILLUNLOCK struct vnode *vp;
383 IN LOCKED=NO struct vnode *vp;
390 IN LOCKED=NO struct vnode *vp;
398 IN LOCKED=YES struct vnode *vp;
409 OUT struct vnode **vpp;
440 IN LOCKED=YES struct vnode *vp;
442 OUT register_t *retval;
449 IN LOCKED=NO struct vnode *vp;
457 #% whiteout dvp L L L
458 #% whiteout cnp - - -
459 #% whiteout flag - - -
461 #! whiteout cnp CREATE, LOCKPARENT
464 IN LOCKED=YES struct vnode *dvp;
465 IN struct componentname *cnp;
482 IN struct vm_page **m;
485 IN vm_prot_t access_type;
501 #% closeextattr vp L L L
504 IN LOCKED=YES struct vnode *vp;
506 IN kauth_cred_t cred;
510 #% getextattr vp L L L
513 IN LOCKED=YES struct vnode *vp;
514 IN int attrnamespace;
516 INOUT struct uio *uio;
518 IN kauth_cred_t cred;
522 #% listextattr vp L L L
525 IN LOCKED=YES struct vnode *vp;
526 IN int attrnamespace;
527 INOUT struct uio *uio;
529 IN kauth_cred_t cred;
533 #% openextattr vp L L L
536 IN LOCKED=YES struct vnode *vp;
537 IN kauth_cred_t cred;
541 #% deleteextattr vp L L L
544 IN LOCKED=YES struct vnode *vp;
545 IN int attrnamespace;
547 IN kauth_cred_t cred;
551 #% setextattr vp L L L
554 IN LOCKED=YES struct vnode *vp;
555 IN int attrnamespace;
557 INOUT struct uio *uio;
558 IN kauth_cred_t cred;