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-coded 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()".
69 # XXX - the lookup locking protocol defies simple description and depends
70 # on the flags and operation fields in the (cnp) structure. Note
71 # especially that *vpp may equal dvp and both may be locked.
75 INOUT struct vnode **vpp;
76 IN struct componentname *cnp;
79 %% cachedlookup dvp L L L
80 %% cachedlookup vpp - L -
82 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
86 INOUT struct vnode **vpp;
87 IN struct componentname *cnp;
92 %! create post vop_create_post
96 OUT struct vnode **vpp;
97 IN struct componentname *cnp;
102 %% whiteout dvp E E E
105 IN struct vnode *dvp;
106 IN struct componentname *cnp;
113 %! mknod post vop_mknod_post
116 IN struct vnode *dvp;
117 OUT struct vnode **vpp;
118 IN struct componentname *cnp;
119 IN struct vattr *vap;
128 IN struct ucred *cred;
129 IN struct thread *td;
139 IN struct ucred *cred;
140 IN struct thread *td;
148 IN accmode_t accmode;
149 IN struct ucred *cred;
150 IN struct thread *td;
158 IN accmode_t accmode;
159 IN struct ucred *cred;
160 IN struct thread *td;
168 OUT struct vattr *vap;
169 IN struct ucred *cred;
174 %! setattr post vop_setattr_post
178 IN struct vattr *vap;
179 IN struct ucred *cred;
182 %% markatime vp L L L
192 INOUT struct uio *uio;
194 IN struct ucred *cred;
199 %! write pre VOP_WRITE_PRE
200 %! write post VOP_WRITE_POST
204 INOUT struct uio *uio;
206 IN struct ucred *cred;
217 IN struct ucred *cred;
218 IN struct thread *td;
227 IN struct ucred *cred;
228 IN struct thread *td;
253 IN struct thread *td;
259 %! remove post vop_remove_post
262 IN struct vnode *dvp;
264 IN struct componentname *cnp;
270 %! link post vop_link_post
273 IN struct vnode *tdvp;
275 IN struct componentname *cnp;
279 %! rename pre vop_rename_pre
280 %! rename post vop_rename_post
283 IN WILLRELE struct vnode *fdvp;
284 IN WILLRELE struct vnode *fvp;
285 IN struct componentname *fcnp;
286 IN WILLRELE struct vnode *tdvp;
287 IN WILLRELE struct vnode *tvp;
288 IN struct componentname *tcnp;
294 %! mkdir post vop_mkdir_post
297 IN struct vnode *dvp;
298 OUT struct vnode **vpp;
299 IN struct componentname *cnp;
300 IN struct vattr *vap;
306 %! rmdir post vop_rmdir_post
309 IN struct vnode *dvp;
311 IN struct componentname *cnp;
317 %! symlink post vop_symlink_post
320 IN struct vnode *dvp;
321 OUT struct vnode **vpp;
322 IN struct componentname *cnp;
323 IN struct vattr *vap;
332 INOUT struct uio *uio;
333 IN struct ucred *cred;
336 INOUT u_long **cookies;
344 INOUT struct uio *uio;
345 IN struct ucred *cred;
353 IN struct thread *td;
361 IN struct thread *td;
365 %! lock1 pre vop_lock_pre
366 %! lock1 post vop_lock_post
376 %! unlock pre vop_unlock_pre
377 %! unlock post vop_unlock_post
390 OUT struct bufobj **bop;
398 %! strategy pre vop_strategy_pre
406 %% getwritemount vp = = =
410 OUT struct mount **mpp;
426 OUT register_t *retval;
441 %% advlockasync vp U U U
449 IN struct task *task;
450 INOUT void **cookiep;
454 %% advlockpurge vp E E E
461 %% reallocblks vp E E E
465 IN struct cluster_save *buflist;
479 %% getpages_async vp L L L
486 IN vop_getpages_iodone_t *iodone;
507 OUT struct acl *aclp;
508 IN struct ucred *cred;
509 IN struct thread *td;
519 IN struct ucred *cred;
520 IN struct thread *td;
530 IN struct ucred *cred;
531 IN struct thread *td;
535 %% closeextattr vp L L L
540 IN struct ucred *cred;
541 IN struct thread *td;
545 %% getextattr vp L L L
549 IN int attrnamespace;
551 INOUT struct uio *uio;
553 IN struct ucred *cred;
554 IN struct thread *td;
558 %% listextattr vp L L L
562 IN int attrnamespace;
563 INOUT struct uio *uio;
565 IN struct ucred *cred;
566 IN struct thread *td;
570 %% openextattr vp L L L
574 IN struct ucred *cred;
575 IN struct thread *td;
579 %% deleteextattr vp E E E
580 %! deleteextattr post vop_deleteextattr_post
584 IN int attrnamespace;
586 IN struct ucred *cred;
587 IN struct thread *td;
591 %% setextattr vp E E E
592 %! setextattr post vop_setextattr_post
596 IN int attrnamespace;
598 INOUT struct uio *uio;
599 IN struct ucred *cred;
600 IN struct thread *td;
608 IN struct label *label;
609 IN struct ucred *cred;
610 IN struct thread *td;
627 OUT struct vnode **vpp;
628 IN struct ucred *cred;
655 IN struct socket *socket;
658 %% unp_connect vp L L L
662 OUT struct socket **socket;
665 %% unp_detach vp = = =
683 %% vop_unset_text vp E E E
689 %% get_writecount vp L L L
696 %% add_writecount vp E E E
703 # The VOPs below are spares at the end of the table to allow new VOPs to be
704 # added in stable branches without breaking the KBI. New VOPs in HEAD should
705 # be added above these spares. When merging a new VOP to a stable branch,
706 # the new VOP should replace one of the spares.