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
30 # Above each of the vop descriptors in lines starting with %%
31 # is a specification of the locking protocol used by each vop call.
32 # The first column is the name of the variable, the remaining three
33 # columns are in, out and error respectively. The "in" column defines
34 # the lock state on input, the "out" column defines the state on successful
35 # return, and the "error" column defines the locking state on error exit.
37 # The locking value can take the following values:
38 # L: locked; not converted to type of lock.
39 # E: locked with exclusive lock for this process.
41 # -: not applicable. vnode does not yet (or no longer) exists.
42 # =: the same on input and output, may be either L or U.
44 # The parameter named "vpp" is assumed to be always used with double
45 # indirection (**vpp) and that name is hard-coded in vnode_if.awk !
47 # Lines starting with %! specify a pre or post-condition function
48 # to call before/after the vop call.
50 # If other such parameters are introduced, they have to be added to
51 # the AWK script at the head of the definition of "add_debug_code()".
62 # XXX - the lookup locking protocol defies simple description and depends
63 # on the flags and operation fields in the (cnp) structure. Note
64 # especially that *vpp may equal dvp and both may be locked.
68 INOUT struct vnode **vpp;
69 IN struct componentname *cnp;
73 %% cachedlookup dvp L L L
74 %% cachedlookup vpp - L -
76 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
80 INOUT struct vnode **vpp;
81 IN struct componentname *cnp;
87 %! create pre vop_create_pre
88 %! create post vop_create_post
92 OUT struct vnode **vpp;
93 IN struct componentname *cnp;
99 %! whiteout pre vop_whiteout_pre
100 %! whiteout post vop_whiteout_post
103 IN struct vnode *dvp;
104 IN struct componentname *cnp;
111 %! mknod pre vop_mknod_pre
112 %! mknod post vop_mknod_post
115 IN struct vnode *dvp;
116 OUT struct vnode **vpp;
117 IN struct componentname *cnp;
118 IN struct vattr *vap;
123 %! open post vop_open_post
128 IN struct ucred *cred;
129 IN struct thread *td;
135 %! close post vop_close_post
140 IN struct ucred *cred;
141 IN struct thread *td;
145 %% fplookup_vexec vp - - -
146 %! fplookup_vexec debugpre vop_fplookup_vexec_debugpre
147 %! fplookup_vexec debugpost vop_fplookup_vexec_debugpost
151 IN struct ucred *cred;
155 %% fplookup_symlink vp - - -
156 %! fplookup_symlink debugpre vop_fplookup_symlink_debugpre
157 %! fplookup_symlink debugpost vop_fplookup_symlink_debugpost
159 vop_fplookup_symlink {
161 IN struct cache_fpl *fpl;
169 IN accmode_t accmode;
170 IN struct ucred *cred;
171 IN struct thread *td;
179 IN accmode_t accmode;
180 IN struct ucred *cred;
181 IN struct thread *td;
190 IN struct ucred *active_cred;
191 IN struct ucred *file_cred;
199 OUT struct vattr *vap;
200 IN struct ucred *cred;
205 %! setattr pre vop_setattr_pre
206 %! setattr post vop_setattr_post
210 IN struct vattr *vap;
211 IN struct ucred *cred;
223 %! read post vop_read_post
227 INOUT struct uio *uio;
229 IN struct ucred *cred;
233 %% read_pgcache vp - - -
234 %! read_pgcache post vop_read_pgcache_post
238 INOUT struct uio *uio;
240 IN struct ucred *cred;
245 %! write pre VOP_WRITE_PRE
246 %! write post VOP_WRITE_POST
250 INOUT struct uio *uio;
252 IN struct ucred *cred;
263 IN struct ucred *cred;
264 IN struct thread *td;
273 IN struct ucred *cred;
274 IN struct thread *td;
295 %! fsync pre vop_fsync_debugpre
296 %! fsync post vop_fsync_debugpost
301 IN struct thread *td;
307 %! remove pre vop_remove_pre
308 %! remove post vop_remove_post
311 IN struct vnode *dvp;
313 IN struct componentname *cnp;
319 %! link pre vop_link_pre
320 %! link post vop_link_post
323 IN struct vnode *tdvp;
325 IN struct componentname *cnp;
329 %! rename pre vop_rename_pre
330 %! rename post vop_rename_post
333 IN WILLRELE struct vnode *fdvp;
334 IN WILLRELE struct vnode *fvp;
335 IN struct componentname *fcnp;
336 IN WILLRELE struct vnode *tdvp;
337 IN WILLRELE struct vnode *tvp;
338 IN struct componentname *tcnp;
344 %! mkdir pre vop_mkdir_pre
345 %! mkdir post vop_mkdir_post
346 %! mkdir debugpost vop_mkdir_debugpost
349 IN struct vnode *dvp;
350 OUT struct vnode **vpp;
351 IN struct componentname *cnp;
352 IN struct vattr *vap;
358 %! rmdir pre vop_rmdir_pre
359 %! rmdir post vop_rmdir_post
362 IN struct vnode *dvp;
364 IN struct componentname *cnp;
370 %! symlink pre vop_symlink_pre
371 %! symlink post vop_symlink_post
374 IN struct vnode *dvp;
375 OUT struct vnode **vpp;
376 IN struct componentname *cnp;
377 IN struct vattr *vap;
378 IN const char *target;
383 %! readdir post vop_readdir_post
387 INOUT struct uio *uio;
388 IN struct ucred *cred;
391 INOUT uint64_t **cookies;
399 INOUT struct uio *uio;
400 IN struct ucred *cred;
410 %! need_inactive debugpre vop_need_inactive_debugpre
411 %! need_inactive debugpost vop_need_inactive_debugpost
418 %! reclaim post vop_reclaim_post
425 %! lock1 debugpre vop_lock_debugpre
426 %! lock1 debugpost vop_lock_debugpost
436 %! unlock debugpre vop_unlock_debugpre
448 OUT struct bufobj **bop;
456 %! strategy debugpre vop_strategy_debugpre
464 %% getwritemount vp = = =
468 OUT struct mount **mpp;
471 %% getwritevnode vp = = =
475 OUT struct vnode **vplp;
506 %% advlockasync vp U U U
514 IN struct task *task;
515 INOUT void **cookiep;
519 %% advlockpurge vp E E E
526 %% reallocblks vp E E E
530 IN struct cluster_save *buflist;
545 %% getpages_async vp L L L
553 IN vop_getpages_iodone_t *iodone;
574 OUT struct acl *aclp;
575 IN struct ucred *cred;
576 IN struct thread *td;
581 %! setacl pre vop_setacl_pre
582 %! setacl post vop_setacl_post
588 IN struct ucred *cred;
589 IN struct thread *td;
599 IN struct ucred *cred;
600 IN struct thread *td;
604 %% closeextattr vp L L L
609 IN struct ucred *cred;
610 IN struct thread *td;
614 %% getextattr vp L L L
618 IN int attrnamespace;
620 INOUT struct uio *uio;
622 IN struct ucred *cred;
623 IN struct thread *td;
627 %% listextattr vp L L L
631 IN int attrnamespace;
632 INOUT struct uio *uio;
634 IN struct ucred *cred;
635 IN struct thread *td;
639 %% openextattr vp L L L
643 IN struct ucred *cred;
644 IN struct thread *td;
648 %% deleteextattr vp E E E
649 %! deleteextattr pre vop_deleteextattr_pre
650 %! deleteextattr post vop_deleteextattr_post
654 IN int attrnamespace;
656 IN struct ucred *cred;
657 IN struct thread *td;
661 %% setextattr vp E E E
662 %! setextattr pre vop_setextattr_pre
663 %! setextattr post vop_setextattr_post
667 IN int attrnamespace;
669 INOUT struct uio *uio;
670 IN struct ucred *cred;
671 IN struct thread *td;
679 IN struct label *label;
680 IN struct ucred *cred;
681 IN struct thread *td;
698 OUT struct vnode **vpp;
700 INOUT size_t *buflen;
711 IN struct ucred *cred;
729 IN struct unpcb *unpcb;
733 %% unp_connect vp L L L
737 OUT struct unpcb **unpcb;
741 %% unp_detach vp = = =
762 %% vop_unset_text vp L L L
769 %% add_writecount vp L L L
777 %% fdatasync vp - - -
778 %! fdatasync pre vop_fdatasync_debugpre
779 %! fdatasync post vop_fdatasync_debugpost
783 IN struct thread *td;
787 %% copy_file_range invp U U U
788 %% copy_file_range outvp U U U
790 vop_copy_file_range {
791 IN struct vnode *invp;
793 IN struct vnode *outvp;
794 INOUT off_t *outoffp;
796 IN unsigned int flags;
797 IN struct ucred *incred;
798 IN struct ucred *outcred;
799 IN struct thread *fsizetd;
803 %% vput_pair dvp E - -
806 IN struct vnode *dvp;
807 INOUT struct vnode **vpp;
812 %% deallocate vp L L L
820 IN struct ucred *cred;
824 # The VOPs below are spares at the end of the table to allow new VOPs to be
825 # added in stable branches without breaking the KBI. New VOPs in HEAD should
826 # be added above these spares. When merging a new VOP to a stable branch,
827 # the new VOP should replace one of the spares.