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;
195 IN struct thread *td;
203 OUT struct vattr *vap;
204 IN struct ucred *cred;
209 %! setattr pre vop_setattr_pre
210 %! setattr post vop_setattr_post
214 IN struct vattr *vap;
215 IN struct ucred *cred;
227 %! read post vop_read_post
231 INOUT struct uio *uio;
233 IN struct ucred *cred;
237 %% read_pgcache vp - - -
238 %! read_pgcache post vop_read_pgcache_post
242 INOUT struct uio *uio;
244 IN struct ucred *cred;
249 %! write pre VOP_WRITE_PRE
250 %! write post VOP_WRITE_POST
254 INOUT struct uio *uio;
256 IN struct ucred *cred;
267 IN struct ucred *cred;
268 IN struct thread *td;
277 IN struct ucred *cred;
278 IN struct thread *td;
299 %! fsync pre vop_fsync_debugpre
300 %! fsync post vop_fsync_debugpost
305 IN struct thread *td;
311 %! remove pre vop_remove_pre
312 %! remove post vop_remove_post
315 IN struct vnode *dvp;
317 IN struct componentname *cnp;
323 %! link pre vop_link_pre
324 %! link post vop_link_post
327 IN struct vnode *tdvp;
329 IN struct componentname *cnp;
333 %! rename pre vop_rename_pre
334 %! rename post vop_rename_post
337 IN WILLRELE struct vnode *fdvp;
338 IN WILLRELE struct vnode *fvp;
339 IN struct componentname *fcnp;
340 IN WILLRELE struct vnode *tdvp;
341 IN WILLRELE struct vnode *tvp;
342 IN struct componentname *tcnp;
348 %! mkdir pre vop_mkdir_pre
349 %! mkdir post vop_mkdir_post
350 %! mkdir debugpost vop_mkdir_debugpost
353 IN struct vnode *dvp;
354 OUT struct vnode **vpp;
355 IN struct componentname *cnp;
356 IN struct vattr *vap;
362 %! rmdir pre vop_rmdir_pre
363 %! rmdir post vop_rmdir_post
366 IN struct vnode *dvp;
368 IN struct componentname *cnp;
374 %! symlink pre vop_symlink_pre
375 %! symlink post vop_symlink_post
378 IN struct vnode *dvp;
379 OUT struct vnode **vpp;
380 IN struct componentname *cnp;
381 IN struct vattr *vap;
382 IN const char *target;
387 %! readdir post vop_readdir_post
391 INOUT struct uio *uio;
392 IN struct ucred *cred;
395 INOUT u_long **cookies;
403 INOUT struct uio *uio;
404 IN struct ucred *cred;
414 %! need_inactive debugpre vop_need_inactive_debugpre
415 %! need_inactive debugpost vop_need_inactive_debugpost
422 %! reclaim post vop_reclaim_post
429 %! lock1 debugpre vop_lock_debugpre
430 %! lock1 debugpost vop_lock_debugpost
440 %! unlock debugpre vop_unlock_debugpre
452 OUT struct bufobj **bop;
460 %! strategy debugpre vop_strategy_debugpre
468 %% getwritemount vp = = =
472 OUT struct mount **mpp;
475 %% getwritevnode vp = = =
479 OUT struct vnode **vplp;
510 %% advlockasync vp U U U
518 IN struct task *task;
519 INOUT void **cookiep;
523 %% advlockpurge vp E E E
530 %% reallocblks vp E E E
534 IN struct cluster_save *buflist;
549 %% getpages_async vp L L L
557 IN vop_getpages_iodone_t *iodone;
578 OUT struct acl *aclp;
579 IN struct ucred *cred;
580 IN struct thread *td;
585 %! setacl pre vop_setacl_pre
586 %! setacl post vop_setacl_post
592 IN struct ucred *cred;
593 IN struct thread *td;
603 IN struct ucred *cred;
604 IN struct thread *td;
608 %% closeextattr vp L L L
613 IN struct ucred *cred;
614 IN struct thread *td;
618 %% getextattr vp L L L
622 IN int attrnamespace;
624 INOUT struct uio *uio;
626 IN struct ucred *cred;
627 IN struct thread *td;
631 %% listextattr vp L L L
635 IN int attrnamespace;
636 INOUT struct uio *uio;
638 IN struct ucred *cred;
639 IN struct thread *td;
643 %% openextattr vp L L L
647 IN struct ucred *cred;
648 IN struct thread *td;
652 %% deleteextattr vp E E E
653 %! deleteextattr pre vop_deleteextattr_pre
654 %! deleteextattr post vop_deleteextattr_post
658 IN int attrnamespace;
660 IN struct ucred *cred;
661 IN struct thread *td;
665 %% setextattr vp E E E
666 %! setextattr pre vop_setextattr_pre
667 %! setextattr post vop_setextattr_post
671 IN int attrnamespace;
673 INOUT struct uio *uio;
674 IN struct ucred *cred;
675 IN struct thread *td;
683 IN struct label *label;
684 IN struct ucred *cred;
685 IN struct thread *td;
702 OUT struct vnode **vpp;
704 INOUT size_t *buflen;
715 IN struct ucred *cred;
733 IN struct unpcb *unpcb;
737 %% unp_connect vp L L L
741 OUT struct unpcb **unpcb;
745 %% unp_detach vp = = =
766 %% vop_unset_text vp L L L
773 %% add_writecount vp L L L
781 %% fdatasync vp - - -
782 %! fdatasync pre vop_fdatasync_debugpre
783 %! fdatasync post vop_fdatasync_debugpost
787 IN struct thread *td;
791 %% copy_file_range invp U U U
792 %% copy_file_range outvp U U U
794 vop_copy_file_range {
795 IN struct vnode *invp;
797 IN struct vnode *outvp;
798 INOUT off_t *outoffp;
800 IN unsigned int flags;
801 IN struct ucred *incred;
802 IN struct ucred *outcred;
803 IN struct thread *fsizetd;
807 %% vput_pair dvp E - -
810 IN struct vnode *dvp;
811 INOUT struct vnode **vpp;
816 # The VOPs below are spares at the end of the table to allow new VOPs to be
817 # added in stable branches without breaking the KBI. New VOPs in HEAD should
818 # be added above these spares. When merging a new VOP to a stable branch,
819 # the new VOP should replace one of the spares.