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.
43 # E: locked with exclusive lock for this process.
45 # -: not applicable. vnode does not yet (or no longer) exists.
46 # =: the same on input and output, may be either L or U.
48 # The paramater named "vpp" is assumed to be always used with double
49 # indirection (**vpp) and that name is hard-coded in vnode_if.awk !
51 # Lines starting with %! specify a pre or post-condition function
52 # to call before/after the vop call.
54 # If other such parameters are introduced, they have to be added to
55 # the AWK script at the head of the definition of "add_debug_code()".
65 # XXX - the lookup locking protocol defies simple description and depends
66 # on the flags and operation fields in the (cnp) structure. Note
67 # especially that *vpp may equal dvp and both may be locked.
71 INOUT struct vnode **vpp;
72 IN struct componentname *cnp;
75 %% cachedlookup dvp L L L
76 %% cachedlookup vpp - L -
78 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
82 INOUT struct vnode **vpp;
83 IN struct componentname *cnp;
88 %! create post vop_create_post
92 OUT struct vnode **vpp;
93 IN struct componentname *cnp;
101 IN struct vnode *dvp;
102 IN struct componentname *cnp;
109 %! mknod post vop_mknod_post
112 IN struct vnode *dvp;
113 OUT struct vnode **vpp;
114 IN struct componentname *cnp;
115 IN struct vattr *vap;
120 %! open post vop_open_post
125 IN struct ucred *cred;
126 IN struct thread *td;
132 %! close post vop_close_post
137 IN struct ucred *cred;
138 IN struct thread *td;
146 IN accmode_t accmode;
147 IN struct ucred *cred;
148 IN struct thread *td;
156 IN accmode_t accmode;
157 IN struct ucred *cred;
158 IN struct thread *td;
166 OUT struct vattr *vap;
167 IN struct ucred *cred;
172 %! setattr post vop_setattr_post
176 IN struct vattr *vap;
177 IN struct ucred *cred;
180 %% markatime vp L L L
187 %! read post vop_read_post
191 INOUT struct uio *uio;
193 IN struct ucred *cred;
198 %! write pre VOP_WRITE_PRE
199 %! write post VOP_WRITE_POST
203 INOUT struct uio *uio;
205 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;
328 %! readdir post vop_readdir_post
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;
358 %! reclaim post vop_reclaim_post
362 IN struct thread *td;
366 %! lock1 pre vop_lock_pre
367 %! lock1 post vop_lock_post
377 %! unlock pre vop_unlock_pre
378 %! unlock post vop_unlock_post
391 OUT struct bufobj **bop;
399 %! strategy pre vop_strategy_pre
407 %% getwritemount vp = = =
411 OUT struct mount **mpp;
427 OUT register_t *retval;
442 %% advlockasync vp U U U
450 IN struct task *task;
451 INOUT void **cookiep;
455 %% advlockpurge vp E E E
462 %% reallocblks vp E E E
466 IN struct cluster_save *buflist;
481 %% getpages_async vp L L L
489 IN vop_getpages_iodone_t *iodone;
510 OUT struct acl *aclp;
511 IN struct ucred *cred;
512 IN struct thread *td;
522 IN struct ucred *cred;
523 IN struct thread *td;
533 IN struct ucred *cred;
534 IN struct thread *td;
538 %% closeextattr vp L L L
543 IN struct ucred *cred;
544 IN struct thread *td;
548 %% getextattr vp L L L
552 IN int attrnamespace;
554 INOUT struct uio *uio;
556 IN struct ucred *cred;
557 IN struct thread *td;
561 %% listextattr vp L L L
565 IN int attrnamespace;
566 INOUT struct uio *uio;
568 IN struct ucred *cred;
569 IN struct thread *td;
573 %% openextattr vp L L L
577 IN struct ucred *cred;
578 IN struct thread *td;
582 %% deleteextattr vp E E E
583 %! deleteextattr post vop_deleteextattr_post
587 IN int attrnamespace;
589 IN struct ucred *cred;
590 IN struct thread *td;
594 %% setextattr vp E E E
595 %! setextattr post vop_setextattr_post
599 IN int attrnamespace;
601 INOUT struct uio *uio;
602 IN struct ucred *cred;
603 IN struct thread *td;
611 IN struct label *label;
612 IN struct ucred *cred;
613 IN struct thread *td;
630 OUT struct vnode **vpp;
631 IN struct ucred *cred;
658 IN struct socket *socket;
661 %% unp_connect vp L L L
665 OUT struct socket **socket;
668 %% unp_detach vp = = =
686 %% vop_unset_text vp E E E
692 %% get_writecount vp L L L
699 %% add_writecount vp E E E
706 # The VOPs below are spares at the end of the table to allow new VOPs to be
707 # added in stable branches without breaking the KBI. New VOPs in HEAD should
708 # be added above these spares. When merging a new VOP to a stable branch,
709 # the new VOP should replace one of the spares.