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()".
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;
124 %! open post vop_open_post
129 IN struct ucred *cred;
130 IN struct thread *td;
136 %! close post vop_close_post
141 IN struct ucred *cred;
142 IN struct thread *td;
150 IN accmode_t accmode;
151 IN struct ucred *cred;
152 IN struct thread *td;
160 IN accmode_t accmode;
161 IN struct ucred *cred;
162 IN struct thread *td;
170 OUT struct vattr *vap;
171 IN struct ucred *cred;
176 %! setattr post vop_setattr_post
180 IN struct vattr *vap;
181 IN struct ucred *cred;
184 %% markatime vp L L L
191 %! read post vop_read_post
195 INOUT struct uio *uio;
197 IN struct ucred *cred;
202 %! write pre VOP_WRITE_PRE
203 %! write post VOP_WRITE_POST
207 INOUT struct uio *uio;
209 IN struct ucred *cred;
220 IN struct ucred *cred;
221 IN struct thread *td;
230 IN struct ucred *cred;
231 IN struct thread *td;
256 IN struct thread *td;
262 %! remove post vop_remove_post
265 IN struct vnode *dvp;
267 IN struct componentname *cnp;
273 %! link post vop_link_post
276 IN struct vnode *tdvp;
278 IN struct componentname *cnp;
282 %! rename pre vop_rename_pre
283 %! rename post vop_rename_post
286 IN WILLRELE struct vnode *fdvp;
287 IN WILLRELE struct vnode *fvp;
288 IN struct componentname *fcnp;
289 IN WILLRELE struct vnode *tdvp;
290 IN WILLRELE struct vnode *tvp;
291 IN struct componentname *tcnp;
297 %! mkdir post vop_mkdir_post
300 IN struct vnode *dvp;
301 OUT struct vnode **vpp;
302 IN struct componentname *cnp;
303 IN struct vattr *vap;
309 %! rmdir post vop_rmdir_post
312 IN struct vnode *dvp;
314 IN struct componentname *cnp;
320 %! symlink post vop_symlink_post
323 IN struct vnode *dvp;
324 OUT struct vnode **vpp;
325 IN struct componentname *cnp;
326 IN struct vattr *vap;
332 %! readdir post vop_readdir_post
336 INOUT struct uio *uio;
337 IN struct ucred *cred;
340 INOUT u_long **cookies;
348 INOUT struct uio *uio;
349 IN struct ucred *cred;
357 IN struct thread *td;
362 %! reclaim post vop_reclaim_post
366 IN struct thread *td;
370 %! lock1 pre vop_lock_pre
371 %! lock1 post vop_lock_post
381 %! unlock pre vop_unlock_pre
382 %! unlock post vop_unlock_post
395 OUT struct bufobj **bop;
403 %! strategy pre vop_strategy_pre
411 %% getwritemount vp = = =
415 OUT struct mount **mpp;
431 OUT register_t *retval;
446 %% advlockasync vp U U U
454 IN struct task *task;
455 INOUT void **cookiep;
459 %% advlockpurge vp E E E
466 %% reallocblks vp E E E
470 IN struct cluster_save *buflist;
481 IN vm_ooffset_t offset;
493 IN vm_ooffset_t offset;
502 OUT struct acl *aclp;
503 IN struct ucred *cred;
504 IN struct thread *td;
514 IN struct ucred *cred;
515 IN struct thread *td;
525 IN struct ucred *cred;
526 IN struct thread *td;
530 %% closeextattr vp L L L
535 IN struct ucred *cred;
536 IN struct thread *td;
540 %% getextattr vp L L L
544 IN int attrnamespace;
546 INOUT struct uio *uio;
548 IN struct ucred *cred;
549 IN struct thread *td;
553 %% listextattr vp L L L
557 IN int attrnamespace;
558 INOUT struct uio *uio;
560 IN struct ucred *cred;
561 IN struct thread *td;
565 %% openextattr vp L L L
569 IN struct ucred *cred;
570 IN struct thread *td;
574 %% deleteextattr vp E E E
575 %! deleteextattr post vop_deleteextattr_post
579 IN int attrnamespace;
581 IN struct ucred *cred;
582 IN struct thread *td;
586 %% setextattr vp E E E
587 %! setextattr post vop_setextattr_post
591 IN int attrnamespace;
593 INOUT struct uio *uio;
594 IN struct ucred *cred;
595 IN struct thread *td;
603 IN struct label *label;
604 IN struct ucred *cred;
605 IN struct thread *td;
622 OUT struct vnode **vpp;
623 IN struct ucred *cred;
650 IN struct socket *socket;
653 %% unp_connect vp L L L
657 OUT struct socket **socket;
660 %% unp_detach vp = = =
678 %% vop_unset_text vp E E E
684 %% get_writecount vp L L L
691 %% add_writecount vp E E E
698 # The VOPs below are spares at the end of the table to allow new VOPs to be
699 # added in stable branches without breaking the KBI. New VOPs in HEAD should
700 # be added above these spares. When merging a new VOP to a stable branch,
701 # the new VOP should replace one of the spares.