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
33 # Above each of the vop descriptors in lines starting with %%
34 # is a specification of the locking protocol used by each vop call.
35 # The first column is the name of the variable, the remaining three
36 # columns are in, out and error respectively. The "in" column defines
37 # the lock state on input, the "out" column defines the state on successful
38 # return, and the "error" column defines the locking state on error exit.
40 # The locking value can take the following values:
41 # L: locked; not converted to type of lock.
42 # E: locked with exclusive lock for this process.
44 # -: not applicable. vnode does not yet (or no longer) exists.
45 # =: the same on input and output, may be either L or U.
47 # The parameter named "vpp" is assumed to be always used with double
48 # indirection (**vpp) and that name is hard-coded in vnode_if.awk !
50 # Lines starting with %! specify a pre or post-condition function
51 # to call before/after the vop call.
53 # If other such parameters are introduced, they have to be added to
54 # 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;
76 %% cachedlookup dvp L L L
77 %% cachedlookup vpp - L -
79 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
83 INOUT struct vnode **vpp;
84 IN struct componentname *cnp;
90 %! create pre vop_create_pre
91 %! create post vop_create_post
95 OUT struct vnode **vpp;
96 IN struct componentname *cnp;
101 %% whiteout dvp E E E
102 %! whiteout pre vop_whiteout_pre
103 %! whiteout post vop_whiteout_post
106 IN struct vnode *dvp;
107 IN struct componentname *cnp;
114 %! mknod pre vop_mknod_pre
115 %! mknod post vop_mknod_post
118 IN struct vnode *dvp;
119 OUT struct vnode **vpp;
120 IN struct componentname *cnp;
121 IN struct vattr *vap;
126 %! open post vop_open_post
131 IN struct ucred *cred;
132 IN struct thread *td;
138 %! close post vop_close_post
143 IN struct ucred *cred;
144 IN struct thread *td;
148 %% fplookup_vexec vp - - -
149 %! fplookup_vexec debugpre vop_fplookup_vexec_debugpre
150 %! fplookup_vexec debugpost vop_fplookup_vexec_debugpost
154 IN struct ucred *cred;
158 %% fplookup_symlink vp - - -
159 %! fplookup_symlink debugpre vop_fplookup_symlink_debugpre
160 %! fplookup_symlink debugpost vop_fplookup_symlink_debugpost
162 vop_fplookup_symlink {
164 IN struct cache_fpl *fpl;
172 IN accmode_t accmode;
173 IN struct ucred *cred;
174 IN struct thread *td;
182 IN accmode_t accmode;
183 IN struct ucred *cred;
184 IN struct thread *td;
193 IN struct ucred *active_cred;
194 IN struct ucred *file_cred;
202 OUT struct vattr *vap;
203 IN struct ucred *cred;
208 %! setattr pre vop_setattr_pre
209 %! setattr post vop_setattr_post
213 IN struct vattr *vap;
214 IN struct ucred *cred;
226 %! read post vop_read_post
230 INOUT struct uio *uio;
232 IN struct ucred *cred;
236 %% read_pgcache vp - - -
237 %! read_pgcache post vop_read_pgcache_post
241 INOUT struct uio *uio;
243 IN struct ucred *cred;
248 %! write pre VOP_WRITE_PRE
249 %! write post VOP_WRITE_POST
253 INOUT struct uio *uio;
255 IN struct ucred *cred;
266 IN struct ucred *cred;
267 IN struct thread *td;
276 IN struct ucred *cred;
277 IN struct thread *td;
298 %! fsync pre vop_fsync_debugpre
299 %! fsync post vop_fsync_debugpost
304 IN struct thread *td;
310 %! remove pre vop_remove_pre
311 %! remove post vop_remove_post
314 IN struct vnode *dvp;
316 IN struct componentname *cnp;
322 %! link pre vop_link_pre
323 %! link post vop_link_post
326 IN struct vnode *tdvp;
328 IN struct componentname *cnp;
332 %! rename pre vop_rename_pre
333 %! rename post vop_rename_post
336 IN WILLRELE struct vnode *fdvp;
337 IN WILLRELE struct vnode *fvp;
338 IN struct componentname *fcnp;
339 IN WILLRELE struct vnode *tdvp;
340 IN WILLRELE struct vnode *tvp;
341 IN struct componentname *tcnp;
347 %! mkdir pre vop_mkdir_pre
348 %! mkdir post vop_mkdir_post
349 %! mkdir debugpost vop_mkdir_debugpost
352 IN struct vnode *dvp;
353 OUT struct vnode **vpp;
354 IN struct componentname *cnp;
355 IN struct vattr *vap;
361 %! rmdir pre vop_rmdir_pre
362 %! rmdir post vop_rmdir_post
365 IN struct vnode *dvp;
367 IN struct componentname *cnp;
373 %! symlink pre vop_symlink_pre
374 %! symlink post vop_symlink_post
377 IN struct vnode *dvp;
378 OUT struct vnode **vpp;
379 IN struct componentname *cnp;
380 IN struct vattr *vap;
381 IN const char *target;
386 %! readdir post vop_readdir_post
390 INOUT struct uio *uio;
391 IN struct ucred *cred;
394 INOUT uint64_t **cookies;
402 INOUT struct uio *uio;
403 IN struct ucred *cred;
413 %! need_inactive debugpre vop_need_inactive_debugpre
414 %! need_inactive debugpost vop_need_inactive_debugpost
421 %! reclaim post vop_reclaim_post
428 %! lock1 debugpre vop_lock_debugpre
429 %! lock1 debugpost vop_lock_debugpost
439 %! unlock debugpre vop_unlock_debugpre
451 OUT struct bufobj **bop;
459 %! strategy debugpre vop_strategy_debugpre
467 %% getwritemount vp = = =
471 OUT struct mount **mpp;
502 %% advlockasync vp U U U
510 IN struct task *task;
511 INOUT void **cookiep;
515 %% advlockpurge vp E E E
522 %% reallocblks vp E E E
526 IN struct cluster_save *buflist;
541 %% getpages_async vp L L L
549 IN vop_getpages_iodone_t *iodone;
570 OUT struct acl *aclp;
571 IN struct ucred *cred;
572 IN struct thread *td;
577 %! setacl pre vop_setacl_pre
578 %! setacl post vop_setacl_post
584 IN struct ucred *cred;
585 IN struct thread *td;
595 IN struct ucred *cred;
596 IN struct thread *td;
600 %% closeextattr vp L L L
605 IN struct ucred *cred;
606 IN struct thread *td;
610 %% getextattr vp L L L
614 IN int attrnamespace;
616 INOUT struct uio *uio;
618 IN struct ucred *cred;
619 IN struct thread *td;
623 %% listextattr vp L L L
627 IN int attrnamespace;
628 INOUT struct uio *uio;
630 IN struct ucred *cred;
631 IN struct thread *td;
635 %% openextattr vp L L L
639 IN struct ucred *cred;
640 IN struct thread *td;
644 %% deleteextattr vp E E E
645 %! deleteextattr pre vop_deleteextattr_pre
646 %! deleteextattr post vop_deleteextattr_post
650 IN int attrnamespace;
652 IN struct ucred *cred;
653 IN struct thread *td;
657 %% setextattr vp E E E
658 %! setextattr pre vop_setextattr_pre
659 %! setextattr post vop_setextattr_post
663 IN int attrnamespace;
665 INOUT struct uio *uio;
666 IN struct ucred *cred;
667 IN struct thread *td;
675 IN struct label *label;
676 IN struct ucred *cred;
677 IN struct thread *td;
694 OUT struct vnode **vpp;
696 INOUT size_t *buflen;
707 IN struct ucred *cred;
725 IN struct unpcb *unpcb;
729 %% unp_connect vp L L L
733 OUT struct unpcb **unpcb;
737 %% unp_detach vp = = =
758 %% vop_unset_text vp L L L
765 %% add_writecount vp L L L
773 %% fdatasync vp - - -
774 %! fdatasync pre vop_fdatasync_debugpre
775 %! fdatasync post vop_fdatasync_debugpost
779 IN struct thread *td;
783 %% copy_file_range invp U U U
784 %% copy_file_range outvp U U U
786 vop_copy_file_range {
787 IN struct vnode *invp;
789 IN struct vnode *outvp;
790 INOUT off_t *outoffp;
792 IN unsigned int flags;
793 IN struct ucred *incred;
794 IN struct ucred *outcred;
795 IN struct thread *fsizetd;
799 %% vput_pair dvp E - -
802 IN struct vnode *dvp;
803 INOUT struct vnode **vpp;
808 %% deallocate vp L L L
816 IN struct ucred *cred;
820 # The VOPs below are spares at the end of the table to allow new VOPs to be
821 # added in stable branches without breaking the KBI. New VOPs in HEAD should
822 # be added above these spares. When merging a new VOP to a stable branch,
823 # the new VOP should replace one of the spares.