2 # Copyright (c) 1992, 1993
3 # The Regents of the University of California. All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 # 4. Neither the name of the University nor the names of its contributors
14 # may be used to endorse or promote products derived from this software
15 # without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 # @(#)vnode_if.src 8.12 (Berkeley) 5/14/95
34 # Above each of the vop descriptors in lines starting with %%
35 # is a specification of the locking protocol used by each vop call.
36 # The first column is the name of the variable, the remaining three
37 # columns are in, out and error respectively. The "in" column defines
38 # the lock state on input, the "out" column defines the state on succesful
39 # return, and the "error" column defines the locking state on error exit.
41 # The locking value can take the following values:
42 # L: locked; not converted to type of lock.
44 # S: locked with shared lock.
45 # E: locked with exclusive lock for this process.
46 # O: locked with exclusive lock for other process.
48 # -: not applicable. vnode does not yet (or no longer) exists.
49 # =: the same on input and output, may be either L or U.
50 # X: locked if not nil.
52 # The paramater named "vpp" is assumed to be always used with double
53 # indirection (**vpp) and that name is hard-codeed in vnode_if.awk !
55 # Lines starting with %! specify a pre or post-condition function
56 # to call before/after the vop call.
58 # If other such parameters are introduced, they have to be added to
59 # the AWK script at the head of the definition of "add_debug_code()".
68 %! lookup pre vop_lookup_pre
69 %! lookup post vop_lookup_post
71 # XXX - the lookup locking protocol defies simple description and depends
72 # on the flags and operation fields in the (cnp) structure. Note
73 # especially that *vpp may equal dvp and both may be locked.
77 INOUT struct vnode **vpp;
78 IN struct componentname *cnp;
81 %% cachedlookup dvp L ? ?
82 %% cachedlookup vpp - L -
84 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
88 INOUT struct vnode **vpp;
89 IN struct componentname *cnp;
94 %! create post vop_create_post
98 OUT struct vnode **vpp;
99 IN struct componentname *cnp;
100 IN struct vattr *vap;
104 %% whiteout dvp E E E
107 IN struct vnode *dvp;
108 IN struct componentname *cnp;
115 %! mknod post vop_mknod_post
118 IN struct vnode *dvp;
119 OUT struct vnode **vpp;
120 IN struct componentname *cnp;
121 IN struct vattr *vap;
130 IN struct ucred *cred;
131 IN struct thread *td;
141 IN struct ucred *cred;
142 IN struct thread *td;
151 IN struct ucred *cred;
152 IN struct thread *td;
160 OUT struct vattr *vap;
161 IN struct ucred *cred;
162 IN struct thread *td;
167 %! setattr post vop_setattr_post
171 IN struct vattr *vap;
172 IN struct ucred *cred;
173 IN struct thread *td;
181 INOUT struct uio *uio;
183 IN struct ucred *cred;
188 %! write pre VOP_WRITE_PRE
189 %! write post VOP_WRITE_POST
193 INOUT struct uio *uio;
195 IN struct ucred *cred;
203 IN struct thread *td;
204 IN struct ucred *cred;
216 IN struct ucred *cred;
217 IN struct thread *td;
226 IN struct ucred *cred;
227 IN struct thread *td;
252 IN struct thread *td;
258 %! remove post vop_remove_post
261 IN struct vnode *dvp;
263 IN struct componentname *cnp;
269 %! link post vop_link_post
272 IN struct vnode *tdvp;
274 IN struct componentname *cnp;
278 %! rename pre vop_rename_pre
279 %! rename post vop_rename_post
282 IN WILLRELE struct vnode *fdvp;
283 IN WILLRELE struct vnode *fvp;
284 IN struct componentname *fcnp;
285 IN WILLRELE struct vnode *tdvp;
286 IN WILLRELE struct vnode *tvp;
287 IN struct componentname *tcnp;
293 %! mkdir post vop_mkdir_post
296 IN struct vnode *dvp;
297 OUT struct vnode **vpp;
298 IN struct componentname *cnp;
299 IN struct vattr *vap;
305 %! rmdir post vop_rmdir_post
308 IN struct vnode *dvp;
310 IN struct componentname *cnp;
316 %! symlink post vop_symlink_post
319 IN struct vnode *dvp;
320 OUT struct vnode **vpp;
321 IN struct componentname *cnp;
322 IN struct vattr *vap;
331 INOUT struct uio *uio;
332 IN struct ucred *cred;
335 INOUT u_long **cookies;
343 INOUT struct uio *uio;
344 IN struct ucred *cred;
352 IN struct thread *td;
360 IN struct thread *td;
364 %! lock1 pre vop_lock_pre
365 %! lock1 post vop_lock_post
375 %! unlock pre vop_unlock_pre
376 %! unlock post vop_unlock_post
389 OUT struct bufobj **bop;
397 %! strategy pre vop_strategy_pre
405 %% getwritemount vp = = =
409 OUT struct mount **mpp;
425 OUT register_t *retval;
440 %% advlockasync vp U U U
448 IN struct task *task;
449 INOUT void **cookiep;
453 %% reallocblks vp E E E
457 IN struct cluster_save *buflist;
468 IN vm_ooffset_t offset;
480 IN vm_ooffset_t offset;
489 OUT struct acl *aclp;
490 IN struct ucred *cred;
491 IN struct thread *td;
501 IN struct ucred *cred;
502 IN struct thread *td;
512 IN struct ucred *cred;
513 IN struct thread *td;
517 %% closeextattr vp L L L
522 IN struct ucred *cred;
523 IN struct thread *td;
527 %% getextattr vp L L L
531 IN int attrnamespace;
533 INOUT struct uio *uio;
535 IN struct ucred *cred;
536 IN struct thread *td;
540 %% listextattr vp L L L
544 IN int attrnamespace;
545 INOUT struct uio *uio;
547 IN struct ucred *cred;
548 IN struct thread *td;
552 %% openextattr vp L L L
556 IN struct ucred *cred;
557 IN struct thread *td;
561 %% deleteextattr vp E E E
565 IN int attrnamespace;
567 IN struct ucred *cred;
568 IN struct thread *td;
572 %% setextattr vp E E E
576 IN int attrnamespace;
578 INOUT struct uio *uio;
579 IN struct ucred *cred;
580 IN struct thread *td;
588 IN struct label *label;
589 IN struct ucred *cred;
590 IN struct thread *td;