2 # Copyright (c) 1995, 1997-1998 Apple Computer, Inc. All Rights Reserved.
3 # Copyright (c) 1992, 1993
4 # The Regents of the University of California. All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # 3. All advertising materials mentioning features or use of this software
15 # must display the following acknowledgement:
16 # This product includes software developed by the University of
17 # California, Berkeley and its contributors.
18 # 4. Neither the name of the University nor the names of its contributors
19 # may be used to endorse or promote products derived from this software
20 # without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 # @(#)vnode_if.src 8.12 (Berkeley) 5/14/95
38 # Above each of the vop descriptors is a specification of the locking
39 # protocol used by each vop call. The first column is the name of
40 # the variable, the remaining three columns are in, out and error
41 # respectively. The "in" column defines the lock state on input,
42 # the "out" column defines the state on succesful return, and the
43 # "error" column defines the locking state on error exit.
45 # The locking value can take the following values:
48 # -: not applicable. vnode does not yet (or no longer) exists.
49 # =: the same on input and output, may be either L or U.
50 # X: locked if not nil.
53 # If a vnode operation if likely to generate buffer cache IO
54 # for file data, add the word "UBC" on the line containing the
55 # name of the vnode operation. The word "UBC" must be the third
56 # word on the line, right after "{".
63 # XXX - the lookup locking protocol defies simple description and depends
64 # on the flags and operation fields in the (cnp) structure. Note
65 # ebly that *vpp may equal dvp and both may be locked.
69 INOUT struct vnode **vpp;
70 IN struct componentname *cnp;
74 #% cachedlookup dvp L ? ?
75 #% cachedlookup vpp - L -
77 # This must be an exact copy of lookup. See kern/vfs_cache.c for details.
81 INOUT struct vnode **vpp;
82 IN struct componentname *cnp;
90 IN WILLRELE struct vnode *dvp;
91 OUT struct vnode **vpp;
92 IN struct componentname *cnp;
99 #% whiteout flag - - -
102 IN WILLRELE struct vnode *dvp;
103 IN struct componentname *cnp;
112 IN WILLRELE struct vnode *dvp;
113 OUT WILLRELE struct vnode **vpp;
114 IN struct componentname *cnp;
115 IN struct vattr *vap;
119 #% mkcomplex dvp L U U
120 #% mkcomplex vpp - X -
123 IN WILLRELE struct vnode *dvp;
124 OUT WILLRELE struct vnode **vpp;
125 IN struct componentname *cnp;
126 IN struct vattr *vap;
136 IN struct ucred *cred;
146 IN struct ucred *cred;
156 IN struct ucred *cred;
165 IN struct vattr *vap;
166 IN struct ucred *cred;
175 IN struct vattr *vap;
176 IN struct ucred *cred;
181 #% getattrlist vp = = =
185 IN struct attrlist *alist;
186 INOUT struct uio *uio;
187 IN struct ucred *cred;
192 #% setattrlist vp L L L
196 IN struct attrlist *alist;
197 INOUT struct uio *uio;
198 IN struct ucred *cred;
207 INOUT struct uio *uio;
209 IN struct ucred *cred;
217 INOUT struct uio *uio;
219 IN struct ucred *cred;
228 IN struct ucred *cred;
240 IN struct ucred *cred;
247 # Needs work? (fflags)
253 IN struct ucred *cred;
259 #% exchange fvp L L L
260 #% exchange tvp L L L
263 IN struct vnode *fvp;
264 IN struct vnode *tvp;
265 IN struct ucred *cred;
270 #% kqfilt_add vp L L L
279 #% kqfilt_remove vp L L L
301 IN struct ucred *cred;
310 IN struct ucred *cred;
317 # Needs work: Is newoff right? What's it mean?
323 IN struct ucred *cred;
331 IN WILLRELE struct vnode *dvp;
332 IN WILLRELE struct vnode *vp;
333 IN struct componentname *cnp;
342 IN WILLRELE struct vnode *tdvp;
343 IN struct componentname *cnp;
353 IN WILLRELE struct vnode *fdvp;
354 IN WILLRELE struct vnode *fvp;
355 IN struct componentname *fcnp;
356 IN WILLRELE struct vnode *tdvp;
357 IN WILLRELE struct vnode *tvp;
358 IN struct componentname *tcnp;
366 IN WILLRELE struct vnode *dvp;
367 OUT struct vnode **vpp;
368 IN struct componentname *cnp;
369 IN struct vattr *vap;
377 IN WILLRELE struct vnode *dvp;
378 IN WILLRELE struct vnode *vp;
379 IN struct componentname *cnp;
386 # XXX - note that the return vnode has already been VRELE'ed
387 # by the filesystem layer. To use it you must use vget,
388 # possibly with a further namei.
391 IN WILLRELE struct vnode *dvp;
392 OUT WILLRELE struct vnode **vpp;
393 IN struct componentname *cnp;
394 IN struct vattr *vap;
403 INOUT struct uio *uio;
404 IN struct ucred *cred;
407 INOUT u_long **cookies;
411 #% readdirattr vp L L L
415 IN struct attrlist *alist;
416 INOUT struct uio *uio;
419 OUT u_long *newstate;
421 OUT u_long *actualcount;
422 OUT u_long **cookies;
423 IN struct ucred *cred;
431 INOUT struct uio *uio;
432 IN struct ucred *cred;
439 IN struct vnode *dvp;
440 IN struct componentname *cnp;
484 OUT struct vnode **vpp;
516 OUT register_t *retval;
537 OUT struct buf **bpp;
544 IN struct vnode *pvp;
546 IN struct ucred *cred;
547 OUT struct vnode **vpp;
551 #% reallocblks vp L L L
555 IN struct cluster_save *buflist;
562 IN struct vnode *pvp;
574 IN struct ucred *cred;
585 OUT off_t *bytesallocated;
587 IN struct ucred *cred;
596 IN struct timeval *access;
597 IN struct timeval *modify;
606 INOUT struct uio *uio;
607 IN struct ucred *cred;
615 INOUT struct uio *uio;
616 IN struct ucred *cred;
617 IN vm_offset_t offset;
633 IN vm_offset_t pl_offset;
636 IN struct ucred *cred;
646 IN vm_offset_t pl_offset;
649 IN struct ucred *cred;
654 #% devblocksize vp = = =
658 OUT register_t *retval;
666 IN void *searchparams1;
667 IN void *searchparams2;
668 IN struct attrlist *searchattrs;
669 IN u_long maxmatches;
670 IN struct timeval *timelimit;
671 OUT struct attrlist *returnattrs;
672 OUT u_long *nummatches;
673 IN u_long scriptcode;
675 INOUT struct uio *uio;
676 INOUT struct searchstate *searchstate;
680 #% copyfile fvp U U U
681 #% copyfile tdvp L U U
682 #% copyfile tvp X U U
685 IN WILLRELE struct vnode *fvp;
686 IN WILLRELE struct vnode *tdvp;
687 IN WILLRELE struct vnode *tvp;
688 IN struct componentname *tcnp;
696 # Given a logical block number for a vnode
708 # Given a file offset for a vnode
709 # return logical block number
720 # Given a file offset and size of IO for a vnode
721 # return physical block number and bytes physically
722 # contiguous at that physical block.
724 # An offset into the physical block may be returned [optional]
725 # This is needed to support 4K/1K UFS on the devices with 2K