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;
258 #% exchange fvp L L L
259 #% exchange tvp L L L
262 IN struct vnode *fvp;
263 IN struct vnode *tvp;
264 IN struct ucred *cred;
282 IN struct ucred *cred;
291 IN struct ucred *cred;
298 # Needs work: Is newoff right? What's it mean?
304 IN struct ucred *cred;
312 IN WILLRELE struct vnode *dvp;
313 IN WILLRELE struct vnode *vp;
314 IN struct componentname *cnp;
322 IN WILLRELE struct vnode *vp;
323 IN struct vnode *tdvp;
324 IN struct componentname *cnp;
334 IN WILLRELE struct vnode *fdvp;
335 IN WILLRELE struct vnode *fvp;
336 IN struct componentname *fcnp;
337 IN WILLRELE struct vnode *tdvp;
338 IN WILLRELE struct vnode *tvp;
339 IN struct componentname *tcnp;
347 IN WILLRELE struct vnode *dvp;
348 OUT struct vnode **vpp;
349 IN struct componentname *cnp;
350 IN struct vattr *vap;
358 IN WILLRELE struct vnode *dvp;
359 IN WILLRELE struct vnode *vp;
360 IN struct componentname *cnp;
367 # XXX - note that the return vnode has already been VRELE'ed
368 # by the filesystem layer. To use it you must use vget,
369 # possibly with a further namei.
372 IN WILLRELE struct vnode *dvp;
373 OUT WILLRELE struct vnode **vpp;
374 IN struct componentname *cnp;
375 IN struct vattr *vap;
384 INOUT struct uio *uio;
385 IN struct ucred *cred;
388 INOUT u_long **cookies;
392 #% readdirattr vp L L L
396 IN struct attrlist *alist;
397 INOUT struct uio *uio;
400 OUT u_long *newstate;
402 OUT u_long *actualcount;
403 OUT u_long **cookies;
404 IN struct ucred *cred;
412 INOUT struct uio *uio;
413 IN struct ucred *cred;
420 IN struct vnode *dvp;
421 IN struct componentname *cnp;
465 OUT struct vnode **vpp;
497 OUT register_t *retval;
518 OUT struct buf **bpp;
525 IN struct vnode *pvp;
527 IN struct ucred *cred;
528 OUT struct vnode **vpp;
532 #% reallocblks vp L L L
536 IN struct cluster_save *buflist;
543 IN struct vnode *pvp;
555 IN struct ucred *cred;
566 OUT off_t *bytesallocated;
567 IN struct ucred *cred;
576 IN struct timeval *access;
577 IN struct timeval *modify;
586 INOUT struct uio *uio;
587 IN struct ucred *cred;
595 INOUT struct uio *uio;
596 IN struct ucred *cred;
597 IN vm_offset_t offset;
613 IN vm_offset_t pl_offset;
616 IN struct ucred *cred;
626 IN vm_offset_t pl_offset;
629 IN struct ucred *cred;
634 #% devblocksize vp = = =
638 OUT register_t *retval;
646 IN void *searchparams1;
647 IN void *searchparams2;
648 IN struct attrlist *searchattrs;
649 IN u_long maxmatches;
650 IN struct timeval *timelimit;
651 OUT struct attrlist *returnattrs;
652 OUT u_long *nummatches;
653 IN u_long scriptcode;
655 INOUT struct uio *uio;
656 INOUT struct searchstate *searchstate;
660 #% copyfile fvp U U U
661 #% copyfile tdvp L U U
662 #% copyfile tvp X U U
665 IN WILLRELE struct vnode *fvp;
666 IN WILLRELE struct vnode *tdvp;
667 IN WILLRELE struct vnode *tvp;
668 IN struct componentname *tcnp;
676 # Given a logical block number for a vnode
688 # Given a file offset for a vnode
689 # return logical block number
700 # Given a file offset and size of IO for a vnode
701 # return physical block number and bytes physically
702 # contiguous at that physical block.
704 # An offset into the physical block may be returned [optional]
705 # This is needed to support 4K/1K UFS on the devices with 2K