3 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
5 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. The rights granted to you under the License
11 * may not be used to create, or enable the creation or redistribution of,
12 * unlawful or unlicensed copies of an Apple operating system, or to
13 * circumvent, violate, or enable the circumvention or violation of, any
14 * terms of an Apple operating system software license agreement.
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this file.
19 * The Original Code and all software distributed under the License are
20 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
21 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
22 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
24 * Please see the License for the specific language governing rights and
25 * limitations under the License.
27 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
31 * Copyright (c) 1992, 1993, 1994, 1995
32 * The Regents of the University of California. All rights reserved.
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions
37 * 1. Redistributions of source code must retain the above copyright
38 * notice, this list of conditions and the following disclaimer.
39 * 2. Redistributions in binary form must reproduce the above copyright
40 * notice, this list of conditions and the following disclaimer in the
41 * documentation and/or other materials provided with the distribution.
42 * 3. All advertising materials mentioning features or use of this software
43 * must display the following acknowledgement:
44 * This product includes software developed by the University of
45 * California, Berkeley and its contributors.
46 * 4. Neither the name of the University nor the names of its contributors
47 * may be used to endorse or promote products derived from this software
48 * without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS AND
51 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
64 * support for mandatory and extensible security protections. This notice
65 * is included in support of clause 2.2 (b) of the Apple Public License,
70 * Warning: This file is generated automatically.
71 * (Modifications made here may easily be lost!)
73 * Created by the script:
74 * @(#)vnode_if.sh 8.7 (Berkeley) 5/11/95
78 #ifndef _SYS_VNODE_IF_H_
79 #define _SYS_VNODE_IF_H_
81 #include <sys/appleapiopts.h>
82 #include <sys/cdefs.h>
83 #include <sys/kernel_types.h>
85 #ifdef BSD_KERNEL_PRIVATE
88 #include <mach/memory_object_types.h>
93 extern struct vnodeop_desc vnop_default_desc
;
94 extern struct vnodeop_desc vnop_lookup_desc
;
95 extern struct vnodeop_desc vnop_create_desc
;
96 extern struct vnodeop_desc vnop_whiteout_desc
;
97 extern struct vnodeop_desc vnop_mknod_desc
;
98 extern struct vnodeop_desc vnop_open_desc
;
99 extern struct vnodeop_desc vnop_close_desc
;
100 extern struct vnodeop_desc vnop_access_desc
;
101 extern struct vnodeop_desc vnop_getattr_desc
;
102 extern struct vnodeop_desc vnop_setattr_desc
;
103 extern struct vnodeop_desc vnop_read_desc
;
104 extern struct vnodeop_desc vnop_write_desc
;
105 extern struct vnodeop_desc vnop_ioctl_desc
;
106 extern struct vnodeop_desc vnop_select_desc
;
107 extern struct vnodeop_desc vnop_exchange_desc
;
108 extern struct vnodeop_desc vnop_revoke_desc
;
109 extern struct vnodeop_desc vnop_mmap_desc
;
110 extern struct vnodeop_desc vnop_mnomap_desc
;
111 extern struct vnodeop_desc vnop_fsync_desc
;
112 extern struct vnodeop_desc vnop_remove_desc
;
113 extern struct vnodeop_desc vnop_link_desc
;
114 extern struct vnodeop_desc vnop_rename_desc
;
115 extern struct vnodeop_desc vnop_mkdir_desc
;
116 extern struct vnodeop_desc vnop_rmdir_desc
;
117 extern struct vnodeop_desc vnop_symlink_desc
;
118 extern struct vnodeop_desc vnop_readdir_desc
;
119 extern struct vnodeop_desc vnop_readdirattr_desc
;
120 extern struct vnodeop_desc vnop_readlink_desc
;
121 extern struct vnodeop_desc vnop_inactive_desc
;
122 extern struct vnodeop_desc vnop_reclaim_desc
;
123 extern struct vnodeop_desc vnop_print_desc
;
124 extern struct vnodeop_desc vnop_pathconf_desc
;
125 extern struct vnodeop_desc vnop_advlock_desc
;
126 extern struct vnodeop_desc vnop_truncate_desc
;
127 extern struct vnodeop_desc vnop_allocate_desc
;
128 extern struct vnodeop_desc vnop_pagein_desc
;
129 extern struct vnodeop_desc vnop_pageout_desc
;
130 extern struct vnodeop_desc vnop_searchfs_desc
;
131 extern struct vnodeop_desc vnop_copyfile_desc
;
132 extern struct vnodeop_desc vnop_blktooff_desc
;
133 extern struct vnodeop_desc vnop_offtoblk_desc
;
134 extern struct vnodeop_desc vnop_blockmap_desc
;
135 extern struct vnodeop_desc vnop_strategy_desc
;
136 extern struct vnodeop_desc vnop_bwrite_desc
;
138 #ifdef __APPLE_API_UNSTABLE
141 extern struct vnodeop_desc vnop_getnamedstream_desc
;
142 extern struct vnodeop_desc vnop_makenamedstream_desc
;
143 extern struct vnodeop_desc vnop_removenamedstream_desc
;
154 struct vnop_lookup_args
{
155 struct vnodeop_desc
*a_desc
;
158 struct componentname
*a_cnp
;
159 vfs_context_t a_context
;
161 extern errno_t
VNOP_LOOKUP(vnode_t
, vnode_t
*, struct componentname
*, vfs_context_t
);
171 struct vnop_create_args
{
172 struct vnodeop_desc
*a_desc
;
175 struct componentname
*a_cnp
;
176 struct vnode_attr
*a_vap
;
177 vfs_context_t a_context
;
179 extern errno_t
VNOP_CREATE(vnode_t
, vnode_t
*, struct componentname
*, struct vnode_attr
*, vfs_context_t
);
183 *#% whiteout dvp L L L
184 *#% whiteout cnp - - -
185 *#% whiteout flag - - -
188 struct vnop_whiteout_args
{
189 struct vnodeop_desc
*a_desc
;
191 struct componentname
*a_cnp
;
193 vfs_context_t a_context
;
195 extern errno_t
VNOP_WHITEOUT(vnode_t
, struct componentname
*, int, vfs_context_t
);
203 struct vnop_mknod_args
{
204 struct vnodeop_desc
*a_desc
;
207 struct componentname
*a_cnp
;
208 struct vnode_attr
*a_vap
;
209 vfs_context_t a_context
;
211 extern errno_t
VNOP_MKNOD(vnode_t
, vnode_t
*, struct componentname
*, struct vnode_attr
*, vfs_context_t
);
218 struct vnop_open_args
{
219 struct vnodeop_desc
*a_desc
;
222 vfs_context_t a_context
;
224 extern errno_t
VNOP_OPEN(vnode_t
, int, vfs_context_t
);
231 struct vnop_close_args
{
232 struct vnodeop_desc
*a_desc
;
235 vfs_context_t a_context
;
237 extern errno_t
VNOP_CLOSE(vnode_t
, int, vfs_context_t
);
244 struct vnop_access_args
{
245 struct vnodeop_desc
*a_desc
;
248 vfs_context_t a_context
;
250 extern errno_t
VNOP_ACCESS(vnode_t
, int, vfs_context_t
);
258 struct vnop_getattr_args
{
259 struct vnodeop_desc
*a_desc
;
261 struct vnode_attr
*a_vap
;
262 vfs_context_t a_context
;
264 extern errno_t
VNOP_GETATTR(vnode_t
, struct vnode_attr
*, vfs_context_t
);
271 struct vnop_setattr_args
{
272 struct vnodeop_desc
*a_desc
;
274 struct vnode_attr
*a_vap
;
275 vfs_context_t a_context
;
277 extern errno_t
VNOP_SETATTR(vnode_t
, struct vnode_attr
*, vfs_context_t
);
285 struct vnop_read_args
{
286 struct vnodeop_desc
*a_desc
;
290 vfs_context_t a_context
;
292 extern errno_t
VNOP_READ(vnode_t
, struct uio
*, int, vfs_context_t
);
300 struct vnop_write_args
{
301 struct vnodeop_desc
*a_desc
;
305 vfs_context_t a_context
;
307 extern errno_t
VNOP_WRITE(vnode_t
, struct uio
*, int, vfs_context_t
);
315 struct vnop_ioctl_args
{
316 struct vnodeop_desc
*a_desc
;
321 vfs_context_t a_context
;
323 extern errno_t
VNOP_IOCTL(vnode_t
, u_long
, caddr_t
, int, vfs_context_t
);
331 struct vnop_select_args
{
332 struct vnodeop_desc
*a_desc
;
337 vfs_context_t a_context
;
339 extern errno_t
VNOP_SELECT(vnode_t
, int, int, void *, vfs_context_t
);
344 *#% exchange fvp L L L
345 *#% exchange tvp L L L
348 struct vnop_exchange_args
{
349 struct vnodeop_desc
*a_desc
;
353 vfs_context_t a_context
;
355 extern errno_t
VNOP_EXCHANGE(vnode_t
, vnode_t
, int, vfs_context_t
);
363 struct vnop_revoke_args
{
364 struct vnodeop_desc
*a_desc
;
367 vfs_context_t a_context
;
369 extern errno_t
VNOP_REVOKE(vnode_t
, int, vfs_context_t
);
377 struct vnop_mmap_args
{
378 struct vnodeop_desc
*a_desc
;
381 vfs_context_t a_context
;
383 extern errno_t
VNOP_MMAP(vnode_t
, int, vfs_context_t
);
390 struct vnop_mnomap_args
{
391 struct vnodeop_desc
*a_desc
;
393 vfs_context_t a_context
;
395 extern errno_t
VNOP_MNOMAP(vnode_t
, vfs_context_t
);
403 struct vnop_fsync_args
{
404 struct vnodeop_desc
*a_desc
;
407 vfs_context_t a_context
;
409 extern errno_t
VNOP_FSYNC(vnode_t
, int, vfs_context_t
);
418 struct vnop_remove_args
{
419 struct vnodeop_desc
*a_desc
;
422 struct componentname
*a_cnp
;
424 vfs_context_t a_context
;
426 extern errno_t
VNOP_REMOVE(vnode_t
, vnode_t
, struct componentname
*, int, vfs_context_t
);
435 struct vnop_link_args
{
436 struct vnodeop_desc
*a_desc
;
439 struct componentname
*a_cnp
;
440 vfs_context_t a_context
;
442 extern errno_t
VNOP_LINK(vnode_t
, vnode_t
, struct componentname
*, vfs_context_t
);
447 *#% rename fdvp U U U
449 *#% rename tdvp L U U
453 struct vnop_rename_args
{
454 struct vnodeop_desc
*a_desc
;
457 struct componentname
*a_fcnp
;
460 struct componentname
*a_tcnp
;
461 vfs_context_t a_context
;
463 extern errno_t
VNOP_RENAME(vnode_t
, vnode_t
, struct componentname
*, vnode_t
, vnode_t
, struct componentname
*, vfs_context_t
);
472 struct vnop_mkdir_args
{
473 struct vnodeop_desc
*a_desc
;
476 struct componentname
*a_cnp
;
477 struct vnode_attr
*a_vap
;
478 vfs_context_t a_context
;
480 extern errno_t
VNOP_MKDIR(vnode_t
, vnode_t
*, struct componentname
*, struct vnode_attr
*, vfs_context_t
);
489 struct vnop_rmdir_args
{
490 struct vnodeop_desc
*a_desc
;
493 struct componentname
*a_cnp
;
494 vfs_context_t a_context
;
496 extern errno_t
VNOP_RMDIR(vnode_t
, vnode_t
, struct componentname
*, vfs_context_t
);
501 *#% symlink dvp L U U
502 *#% symlink vpp - U -
505 struct vnop_symlink_args
{
506 struct vnodeop_desc
*a_desc
;
509 struct componentname
*a_cnp
;
510 struct vnode_attr
*a_vap
;
512 vfs_context_t a_context
;
514 extern errno_t
VNOP_SYMLINK(vnode_t
, vnode_t
*, struct componentname
*, struct vnode_attr
*, char *, vfs_context_t
);
522 * When VNOP_READDIR is called from the NFS Server, the nfs_data
523 * argument is non-NULL.
525 * The value of nfs_eofflag should be set to TRUE if the end of
526 * the directory was reached while reading.
528 * The directory seek offset (cookies) are returned to the NFS client and
529 * may be used later to restart a directory read part way through
530 * the directory. There is one cookie returned for each directory
531 * entry returned and its size is determince from nfs_sizeofcookie.
532 * The value of the cookie should be the logical offset within the
533 * directory where the on-disc version of the appropriate directory
534 * entry starts. Memory for the cookies is allocated from M_TEMP
535 * and it is freed by the caller of VNOP_READDIR.
539 struct vnop_readdir_args
{
540 struct vnodeop_desc
*a_desc
;
546 vfs_context_t a_context
;
548 extern errno_t
VNOP_READDIR(vnode_t
, struct uio
*, int, int *, int *, vfs_context_t
);
553 *#% readdirattr vp L L L
556 struct vnop_readdirattr_args
{
557 struct vnodeop_desc
*a_desc
;
559 struct attrlist
*a_alist
;
565 u_long
*a_actualcount
;
566 vfs_context_t a_context
;
568 extern errno_t
VNOP_READDIRATTR(vnode_t
, struct attrlist
*, struct uio
*, u_long
, u_long
, u_long
*, int *, u_long
*, vfs_context_t
);
573 *#% readlink vp L L L
576 struct vnop_readlink_args
{
577 struct vnodeop_desc
*a_desc
;
580 vfs_context_t a_context
;
582 extern errno_t
VNOP_READLINK(vnode_t
, struct uio
*, vfs_context_t
);
587 *#% inactive vp L U U
590 struct vnop_inactive_args
{
591 struct vnodeop_desc
*a_desc
;
593 vfs_context_t a_context
;
595 extern errno_t
VNOP_INACTIVE(vnode_t
, vfs_context_t
);
603 struct vnop_reclaim_args
{
604 struct vnodeop_desc
*a_desc
;
606 vfs_context_t a_context
;
608 extern errno_t
VNOP_RECLAIM(vnode_t
, vfs_context_t
);
613 *#% pathconf vp L L L
616 struct vnop_pathconf_args
{
617 struct vnodeop_desc
*a_desc
;
620 register_t
*a_retval
;
621 vfs_context_t a_context
;
623 extern errno_t
VNOP_PATHCONF(vnode_t
, int, register_t
*, vfs_context_t
); /* register_t??????? */
631 struct vnop_advlock_args
{
632 struct vnodeop_desc
*a_desc
;
638 vfs_context_t a_context
;
640 extern errno_t
VNOP_ADVLOCK(vnode_t
, caddr_t
, int, struct flock
*, int, vfs_context_t
);
644 *#% allocate vp L L L
647 struct vnop_allocate_args
{
648 struct vnodeop_desc
*a_desc
;
652 off_t
*a_bytesallocated
;
654 vfs_context_t a_context
;
656 extern errno_t
VNOP_ALLOCATE(vnode_t
, off_t
, u_int32_t
, off_t
*, off_t
, vfs_context_t
);
663 struct vnop_pagein_args
{
664 struct vnodeop_desc
*a_desc
;
667 vm_offset_t a_pl_offset
;
671 vfs_context_t a_context
;
673 extern errno_t
VNOP_PAGEIN(vnode_t
, upl_t
, vm_offset_t
, off_t
, size_t, int, vfs_context_t
); /* vm_offset_t ? */
681 struct vnop_pageout_args
{
682 struct vnodeop_desc
*a_desc
;
685 vm_offset_t a_pl_offset
;
689 vfs_context_t a_context
;
691 extern errno_t
VNOP_PAGEOUT(vnode_t
, upl_t
, vm_offset_t
, off_t
, size_t, int, vfs_context_t
);
696 *#% searchfs vp L L L
699 struct vnop_searchfs_args
{
700 struct vnodeop_desc
*a_desc
;
702 void *a_searchparams1
;
703 void *a_searchparams2
;
704 struct attrlist
*a_searchattrs
;
706 struct timeval
*a_timelimit
;
707 struct attrlist
*a_returnattrs
;
708 u_long
*a_nummatches
;
712 struct searchstate
*a_searchstate
;
713 vfs_context_t a_context
;
715 extern errno_t
VNOP_SEARCHFS(vnode_t
, void *, void *, struct attrlist
*, u_long
, struct timeval
*, struct attrlist
*, u_long
*, u_long
, u_long
, struct uio
*, struct searchstate
*, vfs_context_t
);
720 *#% copyfile fvp U U U
721 *#% copyfile tdvp L U U
722 *#% copyfile tvp X U U
725 struct vnop_copyfile_args
{
726 struct vnodeop_desc
*a_desc
;
730 struct componentname
*a_tcnp
;
733 vfs_context_t a_context
;
735 extern errno_t
VNOP_COPYFILE(vnode_t
, vnode_t
, vnode_t
, struct componentname
*, int, int, vfs_context_t
);
738 struct vnop_getxattr_args
{
739 struct vnodeop_desc
*a_desc
;
745 vfs_context_t a_context
;
747 extern struct vnodeop_desc vnop_getxattr_desc
;
748 extern errno_t
VNOP_GETXATTR(vnode_t
, const char *, uio_t
, size_t *, int, vfs_context_t
);
750 struct vnop_setxattr_args
{
751 struct vnodeop_desc
*a_desc
;
756 vfs_context_t a_context
;
758 extern struct vnodeop_desc vnop_setxattr_desc
;
759 extern errno_t
VNOP_SETXATTR(vnode_t
, const char *, uio_t
, int, vfs_context_t
);
761 struct vnop_removexattr_args
{
762 struct vnodeop_desc
*a_desc
;
766 vfs_context_t a_context
;
768 extern struct vnodeop_desc vnop_removexattr_desc
;
769 extern errno_t
VNOP_REMOVEXATTR(vnode_t
, const char *, int, vfs_context_t
);
771 struct vnop_listxattr_args
{
772 struct vnodeop_desc
*a_desc
;
777 vfs_context_t a_context
;
779 extern struct vnodeop_desc vnop_listxattr_desc
;
780 extern errno_t
VNOP_LISTXATTR(vnode_t
, uio_t
, size_t *, int, vfs_context_t
);
785 *#% blktooff vp = = =
788 struct vnop_blktooff_args
{
789 struct vnodeop_desc
*a_desc
;
794 extern errno_t
VNOP_BLKTOOFF(vnode_t
, daddr64_t
, off_t
*);
799 *#% offtoblk vp = = =
802 struct vnop_offtoblk_args
{
803 struct vnodeop_desc
*a_desc
;
808 extern errno_t
VNOP_OFFTOBLK(vnode_t
, off_t
, daddr64_t
*);
813 *#% blockmap vp L L L
816 struct vnop_blockmap_args
{
817 struct vnodeop_desc
*a_desc
;
825 vfs_context_t a_context
;
827 extern errno_t
VNOP_BLOCKMAP(vnode_t
, off_t
, size_t, daddr64_t
*, size_t *, void *,
830 struct vnop_strategy_args
{
831 struct vnodeop_desc
*a_desc
;
834 extern errno_t
VNOP_STRATEGY(struct buf
*bp
);
836 struct vnop_bwrite_args
{
837 struct vnodeop_desc
*a_desc
;
840 extern errno_t
VNOP_BWRITE(buf_t
);
843 struct vnop_kqfilt_add_args
{
844 struct vnodeop_desc
*a_desc
;
847 vfs_context_t a_context
;
849 extern struct vnodeop_desc vnop_kqfilt_add_desc
;
850 extern errno_t
VNOP_KQFILT_ADD(vnode_t
, struct knote
*, vfs_context_t
);
852 struct vnop_kqfilt_remove_args
{
853 struct vnodeop_desc
*a_desc
;
856 vfs_context_t a_context
;
858 extern struct vnodeop_desc vnop_kqfilt_remove_desc
;
859 errno_t
VNOP_KQFILT_REMOVE(vnode_t
, uintptr_t , vfs_context_t
);
862 struct vnop_setlabel_args
{
863 struct vnodeop_desc
*a_desc
;
866 vfs_context_t a_context
;
868 extern struct vnodeop_desc vnop_setlabel_desc
;
869 errno_t
VNOP_SETLABEL(vnode_t
, struct label
*, vfs_context_t
);
871 #ifdef __APPLE_API_UNSTABLE
875 enum nsoperation
{ NS_OPEN
, NS_CREATE
, NS_DELETE
};
877 struct vnop_getnamedstream_args
{
878 struct vnodeop_desc
*a_desc
;
882 enum nsoperation a_operation
;
884 vfs_context_t a_context
;
886 extern errno_t
VNOP_GETNAMEDSTREAM(vnode_t
, vnode_t
*, const char *, enum nsoperation
, int flags
, vfs_context_t
);
888 struct vnop_makenamedstream_args
{
889 struct vnodeop_desc
*a_desc
;
894 vfs_context_t a_context
;
896 extern errno_t
VNOP_MAKENAMEDSTREAM(vnode_t
, vnode_t
*, const char *, int flags
, vfs_context_t
);
898 struct vnop_removenamedstream_args
{
899 struct vnodeop_desc
*a_desc
;
904 vfs_context_t a_context
;
906 extern errno_t
VNOP_REMOVENAMEDSTREAM(vnode_t
, vnode_t
, const char *, int flags
, vfs_context_t
);
915 #endif /* !_SYS_VNODE_IF_H_ */