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 # 3. 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()".
66 # XXX - the lookup locking protocol defies simple description and depends
67 # on the flags and operation fields in the (cnp) structure. Note
68 # especially that *vpp may equal dvp and both may be locked.
72 INOUT struct vnode **vpp;
73 IN struct componentname *cnp;
77 %% cachedlookup dvp L L L
78 %% cachedlookup vpp - L -
80 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
84 INOUT struct vnode **vpp;
85 IN struct componentname *cnp;
91 %! create pre vop_create_pre
92 %! create post vop_create_post
96 OUT struct vnode **vpp;
97 IN struct componentname *cnp;
102 %% whiteout dvp E E E
103 %! whiteout pre vop_whiteout_pre
104 %! whiteout post vop_whiteout_post
107 IN struct vnode *dvp;
108 IN struct componentname *cnp;
115 %! mknod pre vop_mknod_pre
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;
149 %% fplookup_vexec vp - - -
150 %! fplookup_vexec debugpre vop_fplookup_vexec_debugpre
151 %! fplookup_vexec debugpost vop_fplookup_vexec_debugpost
155 IN struct ucred *cred;
156 IN struct thread *td;
164 IN accmode_t accmode;
165 IN struct ucred *cred;
166 IN struct thread *td;
174 IN accmode_t accmode;
175 IN struct ucred *cred;
176 IN struct thread *td;
184 OUT struct vattr *vap;
185 IN struct ucred *cred;
190 %! setattr pre vop_setattr_pre
191 %! setattr post vop_setattr_post
195 IN struct vattr *vap;
196 IN struct ucred *cred;
208 %! read post vop_read_post
212 INOUT struct uio *uio;
214 IN struct ucred *cred;
219 %! write pre VOP_WRITE_PRE
220 %! write post VOP_WRITE_POST
224 INOUT struct uio *uio;
226 IN struct ucred *cred;
237 IN struct ucred *cred;
238 IN struct thread *td;
247 IN struct ucred *cred;
248 IN struct thread *td;
273 IN struct thread *td;
279 %! remove pre vop_remove_pre
280 %! remove post vop_remove_post
283 IN struct vnode *dvp;
285 IN struct componentname *cnp;
291 %! link pre vop_link_pre
292 %! link post vop_link_post
295 IN struct vnode *tdvp;
297 IN struct componentname *cnp;
301 %! rename pre vop_rename_pre
302 %! rename post vop_rename_post
305 IN WILLRELE struct vnode *fdvp;
306 IN WILLRELE struct vnode *fvp;
307 IN struct componentname *fcnp;
308 IN WILLRELE struct vnode *tdvp;
309 IN WILLRELE struct vnode *tvp;
310 IN struct componentname *tcnp;
316 %! mkdir pre vop_mkdir_pre
317 %! mkdir post vop_mkdir_post
320 IN struct vnode *dvp;
321 OUT struct vnode **vpp;
322 IN struct componentname *cnp;
323 IN struct vattr *vap;
329 %! rmdir pre vop_rmdir_pre
330 %! rmdir post vop_rmdir_post
333 IN struct vnode *dvp;
335 IN struct componentname *cnp;
341 %! symlink pre vop_symlink_pre
342 %! symlink post vop_symlink_post
345 IN struct vnode *dvp;
346 OUT struct vnode **vpp;
347 IN struct componentname *cnp;
348 IN struct vattr *vap;
349 IN const char *target;
354 %! readdir post vop_readdir_post
358 INOUT struct uio *uio;
359 IN struct ucred *cred;
362 INOUT u_long **cookies;
370 INOUT struct uio *uio;
371 IN struct ucred *cred;
379 IN struct thread *td;
382 %! need_inactive debugpre vop_need_inactive_debugpre
383 %! need_inactive debugpost vop_need_inactive_debugpost
390 %! reclaim post vop_reclaim_post
394 IN struct thread *td;
398 %! lock1 debugpre vop_lock_debugpre
399 %! lock1 debugpost vop_lock_debugpost
409 %! unlock debugpre vop_unlock_debugpre
421 OUT struct bufobj **bop;
429 %! strategy debugpre vop_strategy_debugpre
437 %% getwritemount vp = = =
441 OUT struct mount **mpp;
472 %% advlockasync vp U U U
480 IN struct task *task;
481 INOUT void **cookiep;
485 %% advlockpurge vp E E E
492 %% reallocblks vp E E E
496 IN struct cluster_save *buflist;
511 %% getpages_async vp L L L
519 IN vop_getpages_iodone_t *iodone;
540 OUT struct acl *aclp;
541 IN struct ucred *cred;
542 IN struct thread *td;
547 %! setacl pre vop_setacl_pre
548 %! setacl post vop_setacl_post
554 IN struct ucred *cred;
555 IN struct thread *td;
565 IN struct ucred *cred;
566 IN struct thread *td;
570 %% closeextattr vp L L L
575 IN struct ucred *cred;
576 IN struct thread *td;
580 %% getextattr vp L L L
584 IN int attrnamespace;
586 INOUT struct uio *uio;
588 IN struct ucred *cred;
589 IN struct thread *td;
593 %% listextattr vp L L L
597 IN int attrnamespace;
598 INOUT struct uio *uio;
600 IN struct ucred *cred;
601 IN struct thread *td;
605 %% openextattr vp L L L
609 IN struct ucred *cred;
610 IN struct thread *td;
614 %% deleteextattr vp E E E
615 %! deleteextattr pre vop_deleteextattr_pre
616 %! deleteextattr post vop_deleteextattr_post
620 IN int attrnamespace;
622 IN struct ucred *cred;
623 IN struct thread *td;
627 %% setextattr vp E E E
628 %! setextattr pre vop_setextattr_pre
629 %! setextattr post vop_setextattr_post
633 IN int attrnamespace;
635 INOUT struct uio *uio;
636 IN struct ucred *cred;
637 IN struct thread *td;
645 IN struct label *label;
646 IN struct ucred *cred;
647 IN struct thread *td;
664 OUT struct vnode **vpp;
665 IN struct ucred *cred;
667 INOUT size_t *buflen;
694 IN struct unpcb *unpcb;
698 %% unp_connect vp L L L
702 OUT struct unpcb **unpcb;
706 %% unp_detach vp = = =
727 %% vop_unset_text vp L L L
734 %% add_writecount vp L L L
742 %% fdatasync vp L L L
746 IN struct thread *td;
750 %% copy_file_range invp U U U
751 %% copy_file_range outvp U U U
753 vop_copy_file_range {
754 IN struct vnode *invp;
756 IN struct vnode *outvp;
757 INOUT off_t *outoffp;
759 IN unsigned int flags;
760 IN struct ucred *incred;
761 IN struct ucred *outcred;
762 IN struct thread *fsizetd;
766 # The VOPs below are spares at the end of the table to allow new VOPs to be
767 # added in stable branches without breaking the KBI. New VOPs in HEAD should
768 # be added above these spares. When merging a new VOP to a stable branch,
769 # the new VOP should replace one of the spares.