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 successful
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()".
70 # XXX - the lookup locking protocol defies simple description and depends
71 # on the flags and operation fields in the (cnp) structure. Note
72 # especially that *vpp may equal dvp and both may be locked.
76 INOUT struct vnode **vpp;
77 IN struct componentname *cnp;
81 %% cachedlookup dvp L L 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;
95 %! create post vop_create_post
99 OUT struct vnode **vpp;
100 IN struct componentname *cnp;
101 IN struct vattr *vap;
105 %% whiteout dvp E E E
108 IN struct vnode *dvp;
109 IN struct componentname *cnp;
116 %! mknod post vop_mknod_post
119 IN struct vnode *dvp;
120 OUT struct vnode **vpp;
121 IN struct componentname *cnp;
122 IN struct vattr *vap;
127 %! open post vop_open_post
132 IN struct ucred *cred;
133 IN struct thread *td;
139 %! close post vop_close_post
144 IN struct ucred *cred;
145 IN struct thread *td;
153 IN accmode_t accmode;
154 IN struct ucred *cred;
155 IN struct thread *td;
163 IN accmode_t accmode;
164 IN struct ucred *cred;
165 IN struct thread *td;
173 OUT struct vattr *vap;
174 IN struct ucred *cred;
179 %! setattr post vop_setattr_post
183 IN struct vattr *vap;
184 IN struct ucred *cred;
188 %% markatime vp L L L
196 %! read post vop_read_post
200 INOUT struct uio *uio;
202 IN struct ucred *cred;
207 %! write pre VOP_WRITE_PRE
208 %! write post VOP_WRITE_POST
212 INOUT struct uio *uio;
214 IN struct ucred *cred;
225 IN struct ucred *cred;
226 IN struct thread *td;
235 IN struct ucred *cred;
236 IN struct thread *td;
261 IN struct thread *td;
267 %! remove post vop_remove_post
270 IN struct vnode *dvp;
272 IN struct componentname *cnp;
278 %! link post vop_link_post
281 IN struct vnode *tdvp;
283 IN struct componentname *cnp;
287 %! rename pre vop_rename_pre
288 %! rename post vop_rename_post
291 IN WILLRELE struct vnode *fdvp;
292 IN WILLRELE struct vnode *fvp;
293 IN struct componentname *fcnp;
294 IN WILLRELE struct vnode *tdvp;
295 IN WILLRELE struct vnode *tvp;
296 IN struct componentname *tcnp;
302 %! mkdir post vop_mkdir_post
305 IN struct vnode *dvp;
306 OUT struct vnode **vpp;
307 IN struct componentname *cnp;
308 IN struct vattr *vap;
314 %! rmdir post vop_rmdir_post
317 IN struct vnode *dvp;
319 IN struct componentname *cnp;
325 %! symlink post vop_symlink_post
328 IN struct vnode *dvp;
329 OUT struct vnode **vpp;
330 IN struct componentname *cnp;
331 IN struct vattr *vap;
337 %! readdir post vop_readdir_post
341 INOUT struct uio *uio;
342 IN struct ucred *cred;
345 INOUT u_long **cookies;
353 INOUT struct uio *uio;
354 IN struct ucred *cred;
362 IN struct thread *td;
367 %! reclaim post vop_reclaim_post
371 IN struct thread *td;
375 %! lock1 pre vop_lock_pre
376 %! lock1 post vop_lock_post
386 %! unlock pre vop_unlock_pre
387 %! unlock post vop_unlock_post
400 OUT struct bufobj **bop;
408 %! strategy pre vop_strategy_pre
416 %% getwritemount vp = = =
420 OUT struct mount **mpp;
436 OUT register_t *retval;
451 %% advlockasync vp U U U
459 IN struct task *task;
460 INOUT void **cookiep;
464 %% advlockpurge vp E E E
471 %% reallocblks vp E E E
475 IN struct cluster_save *buflist;
490 %% getpages_async vp L L L
498 IN vop_getpages_iodone_t *iodone;
519 OUT struct acl *aclp;
520 IN struct ucred *cred;
521 IN struct thread *td;
531 IN struct ucred *cred;
532 IN struct thread *td;
542 IN struct ucred *cred;
543 IN struct thread *td;
547 %% closeextattr vp L L L
552 IN struct ucred *cred;
553 IN struct thread *td;
557 %% getextattr vp L L L
561 IN int attrnamespace;
563 INOUT struct uio *uio;
565 IN struct ucred *cred;
566 IN struct thread *td;
570 %% listextattr vp L L L
574 IN int attrnamespace;
575 INOUT struct uio *uio;
577 IN struct ucred *cred;
578 IN struct thread *td;
582 %% openextattr vp L L L
586 IN struct ucred *cred;
587 IN struct thread *td;
591 %% deleteextattr vp E E E
592 %! deleteextattr post vop_deleteextattr_post
596 IN int attrnamespace;
598 IN struct ucred *cred;
599 IN struct thread *td;
603 %% setextattr vp E E E
604 %! setextattr post vop_setextattr_post
608 IN int attrnamespace;
610 INOUT struct uio *uio;
611 IN struct ucred *cred;
612 IN struct thread *td;
620 IN struct label *label;
621 IN struct ucred *cred;
622 IN struct thread *td;
639 OUT struct vnode **vpp;
640 IN struct ucred *cred;
669 IN struct socket *socket;
673 %% unp_connect vp L L L
677 OUT struct socket **socket;
681 %% unp_detach vp = = =
702 %% vop_unset_text vp E E E
709 %% get_writecount vp L L L
717 %% add_writecount vp E E E
725 %% fdatasync vp L L L
729 IN struct thread *td;
733 # The VOPs below are spares at the end of the table to allow new VOPs to be
734 # added in stable branches without breaking the KBI. New VOPs in HEAD should
735 # be added above these spares. When merging a new VOP to a stable branch,
736 # the new VOP should replace one of the spares.