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;
283 IN struct ucred *cred;
292 IN struct ucred *cred;
299 # Needs work: Is newoff right? What's it mean?
305 IN struct ucred *cred;
313 IN WILLRELE struct vnode *dvp;
314 IN WILLRELE struct vnode *vp;
315 IN struct componentname *cnp;
323 IN WILLRELE struct vnode *vp;
324 IN struct vnode *tdvp;
325 IN struct componentname *cnp;
335 IN WILLRELE struct vnode *fdvp;
336 IN WILLRELE struct vnode *fvp;
337 IN struct componentname *fcnp;
338 IN WILLRELE struct vnode *tdvp;
339 IN WILLRELE struct vnode *tvp;
340 IN struct componentname *tcnp;
348 IN WILLRELE struct vnode *dvp;
349 OUT struct vnode **vpp;
350 IN struct componentname *cnp;
351 IN struct vattr *vap;
359 IN WILLRELE struct vnode *dvp;
360 IN WILLRELE struct vnode *vp;
361 IN struct componentname *cnp;
368 # XXX - note that the return vnode has already been VRELE'ed
369 # by the filesystem layer. To use it you must use vget,
370 # possibly with a further namei.
373 IN WILLRELE struct vnode *dvp;
374 OUT WILLRELE struct vnode **vpp;
375 IN struct componentname *cnp;
376 IN struct vattr *vap;
385 INOUT struct uio *uio;
386 IN struct ucred *cred;
389 INOUT u_long **cookies;
393 #% readdirattr vp L L L
397 IN struct attrlist *alist;
398 INOUT struct uio *uio;
401 OUT u_long *newstate;
403 OUT u_long *actualcount;
404 OUT u_long **cookies;
405 IN struct ucred *cred;
413 INOUT struct uio *uio;
414 IN struct ucred *cred;
421 IN struct vnode *dvp;
422 IN struct componentname *cnp;
466 OUT struct vnode **vpp;
498 OUT register_t *retval;
519 OUT struct buf **bpp;
526 IN struct vnode *pvp;
528 IN struct ucred *cred;
529 OUT struct vnode **vpp;
533 #% reallocblks vp L L L
537 IN struct cluster_save *buflist;
544 IN struct vnode *pvp;
556 IN struct ucred *cred;
567 OUT off_t *bytesallocated;
569 IN struct ucred *cred;
578 IN struct timeval *access;
579 IN struct timeval *modify;
588 INOUT struct uio *uio;
589 IN struct ucred *cred;
597 INOUT struct uio *uio;
598 IN struct ucred *cred;
599 IN vm_offset_t offset;
615 IN vm_offset_t pl_offset;
618 IN struct ucred *cred;
628 IN vm_offset_t pl_offset;
631 IN struct ucred *cred;
636 #% devblocksize vp = = =
640 OUT register_t *retval;
648 IN void *searchparams1;
649 IN void *searchparams2;
650 IN struct attrlist *searchattrs;
651 IN u_long maxmatches;
652 IN struct timeval *timelimit;
653 OUT struct attrlist *returnattrs;
654 OUT u_long *nummatches;
655 IN u_long scriptcode;
657 INOUT struct uio *uio;
658 INOUT struct searchstate *searchstate;
662 #% copyfile fvp U U U
663 #% copyfile tdvp L U U
664 #% copyfile tvp X U U
667 IN WILLRELE struct vnode *fvp;
668 IN WILLRELE struct vnode *tdvp;
669 IN WILLRELE struct vnode *tvp;
670 IN struct componentname *tcnp;
678 # Given a logical block number for a vnode
690 # Given a file offset for a vnode
691 # return logical block number
702 # Given a file offset and size of IO for a vnode
703 # return physical block number and bytes physically
704 # contiguous at that physical block.
706 # An offset into the physical block may be returned [optional]
707 # This is needed to support 4K/1K UFS on the devices with 2K