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 post vop_create_post
95 OUT struct vnode **vpp;
96 IN struct componentname *cnp;
101 %% whiteout dvp E E E
104 IN struct vnode *dvp;
105 IN struct componentname *cnp;
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;
149 IN accmode_t accmode;
150 IN struct ucred *cred;
151 IN struct thread *td;
159 IN accmode_t accmode;
160 IN struct ucred *cred;
161 IN struct thread *td;
169 OUT struct vattr *vap;
170 IN struct ucred *cred;
175 %! setattr post vop_setattr_post
179 IN struct vattr *vap;
180 IN struct ucred *cred;
184 %% markatime vp L L L
192 %! read post vop_read_post
196 INOUT struct uio *uio;
198 IN struct ucred *cred;
203 %! write pre VOP_WRITE_PRE
204 %! write post VOP_WRITE_POST
208 INOUT struct uio *uio;
210 IN struct ucred *cred;
221 IN struct ucred *cred;
222 IN struct thread *td;
231 IN struct ucred *cred;
232 IN struct thread *td;
257 IN struct thread *td;
263 %! remove post vop_remove_post
266 IN struct vnode *dvp;
268 IN struct componentname *cnp;
274 %! link post vop_link_post
277 IN struct vnode *tdvp;
279 IN struct componentname *cnp;
283 %! rename pre vop_rename_pre
284 %! rename post vop_rename_post
287 IN WILLRELE struct vnode *fdvp;
288 IN WILLRELE struct vnode *fvp;
289 IN struct componentname *fcnp;
290 IN WILLRELE struct vnode *tdvp;
291 IN WILLRELE struct vnode *tvp;
292 IN struct componentname *tcnp;
298 %! mkdir post vop_mkdir_post
301 IN struct vnode *dvp;
302 OUT struct vnode **vpp;
303 IN struct componentname *cnp;
304 IN struct vattr *vap;
310 %! rmdir post vop_rmdir_post
313 IN struct vnode *dvp;
315 IN struct componentname *cnp;
321 %! symlink post vop_symlink_post
324 IN struct vnode *dvp;
325 OUT struct vnode **vpp;
326 IN struct componentname *cnp;
327 IN struct vattr *vap;
328 IN const char *target;
333 %! readdir post vop_readdir_post
337 INOUT struct uio *uio;
338 IN struct ucred *cred;
341 INOUT u_long **cookies;
349 INOUT struct uio *uio;
350 IN struct ucred *cred;
358 IN struct thread *td;
361 %! need_inactive pre vop_need_inactive_pre
362 %! need_inactive post vop_need_inactive_post
369 %! reclaim post vop_reclaim_post
373 IN struct thread *td;
377 %! lock1 pre vop_lock_pre
378 %! lock1 post vop_lock_post
388 %! unlock pre vop_unlock_pre
389 %! unlock post vop_unlock_post
402 OUT struct bufobj **bop;
410 %! strategy pre vop_strategy_pre
418 %% getwritemount vp = = =
422 OUT struct mount **mpp;
453 %% advlockasync vp U U U
461 IN struct task *task;
462 INOUT void **cookiep;
466 %% advlockpurge vp E E E
473 %% reallocblks vp E E E
477 IN struct cluster_save *buflist;
492 %% getpages_async vp L L L
500 IN vop_getpages_iodone_t *iodone;
521 OUT struct acl *aclp;
522 IN struct ucred *cred;
523 IN struct thread *td;
533 IN struct ucred *cred;
534 IN struct thread *td;
544 IN struct ucred *cred;
545 IN struct thread *td;
549 %% closeextattr vp L L L
554 IN struct ucred *cred;
555 IN struct thread *td;
559 %% getextattr vp L L L
563 IN int attrnamespace;
565 INOUT struct uio *uio;
567 IN struct ucred *cred;
568 IN struct thread *td;
572 %% listextattr vp L L L
576 IN int attrnamespace;
577 INOUT struct uio *uio;
579 IN struct ucred *cred;
580 IN struct thread *td;
584 %% openextattr vp L L L
588 IN struct ucred *cred;
589 IN struct thread *td;
593 %% deleteextattr vp E E E
594 %! deleteextattr post vop_deleteextattr_post
598 IN int attrnamespace;
600 IN struct ucred *cred;
601 IN struct thread *td;
605 %% setextattr vp E E E
606 %! setextattr post vop_setextattr_post
610 IN int attrnamespace;
612 INOUT struct uio *uio;
613 IN struct ucred *cred;
614 IN struct thread *td;
622 IN struct label *label;
623 IN struct ucred *cred;
624 IN struct thread *td;
641 OUT struct vnode **vpp;
642 IN struct ucred *cred;
671 IN struct unpcb *unpcb;
675 %% unp_connect vp L L L
679 OUT struct unpcb **unpcb;
683 %% unp_detach vp = = =
704 %% vop_unset_text vp L L L
711 %% add_writecount vp L L L
719 %% fdatasync vp L L L
723 IN struct thread *td;
727 %% copy_file_range invp U U U
728 %% copy_file_range outvp U U U
730 vop_copy_file_range {
731 IN struct vnode *invp;
733 IN struct vnode *outvp;
734 INOUT off_t *outoffp;
736 IN unsigned int flags;
737 IN struct ucred *incred;
738 IN struct ucred *outcred;
739 IN struct thread *fsizetd;
743 # The VOPs below are spares at the end of the table to allow new VOPs to be
744 # added in stable branches without breaking the KBI. New VOPs in HEAD should
745 # be added above these spares. When merging a new VOP to a stable branch,
746 # the new VOP should replace one of the spares.