X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8ad349bb6ed4a0be06e34c92be0d98b92e078db4..e2fac8b15b12a7979f72090454d850e612fc5b13:/bsd/vfs/vnode_if.c diff --git a/bsd/vfs/vnode_if.c b/bsd/vfs/vnode_if.c index 076505596..df30827ae 100644 --- a/bsd/vfs/vnode_if.c +++ b/bsd/vfs/vnode_if.c @@ -1,32 +1,30 @@ /* - * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved. + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * - * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the - * License may not be used to create, or enable the creation or - * redistribution of, unlawful or unlicensed copies of an Apple operating - * system, or to circumvent, violate, or enable the circumvention or - * violation of, any terms of an Apple operating system software license - * agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and * limitations under the License. - * - * @APPLE_LICENSE_OSREFERENCE_HEADER_END@ + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved @@ -86,7 +84,8 @@ struct vnodeop_desc vnop_default_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; @@ -104,7 +103,7 @@ struct vnodeop_desc vnop_lookup_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_lookup_args, a_cnp), VOPARG_OFFSETOF(struct vnop_lookup_args, a_context), - NULL, + NULL }; int vnop_create_vp_offsets[] = { @@ -121,7 +120,7 @@ struct vnodeop_desc vnop_create_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_create_args, a_cnp), VOPARG_OFFSETOF(struct vnop_create_args, a_context), - NULL, + NULL }; int vnop_whiteout_vp_offsets[] = { @@ -138,7 +137,7 @@ struct vnodeop_desc vnop_whiteout_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_whiteout_args, a_cnp), VOPARG_OFFSETOF(struct vnop_whiteout_args, a_context), - NULL, + NULL }; int vnop_mknod_vp_offsets[] = { @@ -155,7 +154,7 @@ struct vnodeop_desc vnop_mknod_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_mknod_args, a_cnp), VOPARG_OFFSETOF(struct vnop_mknod_args, a_context), - NULL, + NULL }; int vnop_open_vp_offsets[] = { @@ -172,7 +171,7 @@ struct vnodeop_desc vnop_open_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_open_args, a_context), - NULL, + NULL }; int vnop_close_vp_offsets[] = { @@ -189,7 +188,7 @@ struct vnodeop_desc vnop_close_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_close_args, a_context), - NULL, + NULL }; int vnop_access_vp_offsets[] = { @@ -206,7 +205,7 @@ struct vnodeop_desc vnop_access_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_close_args, a_context), - NULL, + NULL }; int vnop_getattr_vp_offsets[] = { @@ -223,7 +222,7 @@ struct vnodeop_desc vnop_getattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_getattr_args, a_context), - NULL, + NULL }; int vnop_setattr_vp_offsets[] = { @@ -240,41 +239,7 @@ struct vnodeop_desc vnop_setattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_setattr_args, a_context), - NULL, -}; - -int vnop_getattrlist_vp_offsets[] = { - VOPARG_OFFSETOF(struct vnop_getattrlist_args,a_vp), - VDESC_NO_OFFSET -}; -struct vnodeop_desc vnop_getattrlist_desc = { - 0, - "vnop_getattrlist", - 0, - vnop_getattrlist_vp_offsets, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VOPARG_OFFSETOF(struct vnop_getattrlist_args, a_context), - NULL, -}; - -int vnop_setattrlist_vp_offsets[] = { - VOPARG_OFFSETOF(struct vnop_setattrlist_args,a_vp), - VDESC_NO_OFFSET -}; -struct vnodeop_desc vnop_setattrlist_desc = { - 0, - "vnop_setattrlist", - 0, - vnop_setattrlist_vp_offsets, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VOPARG_OFFSETOF(struct vnop_setattrlist_args, a_context), - NULL, + NULL }; int vnop_read_vp_offsets[] = { @@ -291,7 +256,7 @@ struct vnodeop_desc vnop_read_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_read_args, a_context), - NULL, + NULL }; int vnop_write_vp_offsets[] = { @@ -308,7 +273,7 @@ struct vnodeop_desc vnop_write_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_write_args, a_context), - NULL, + NULL }; int vnop_ioctl_vp_offsets[] = { @@ -325,7 +290,7 @@ struct vnodeop_desc vnop_ioctl_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_ioctl_args, a_context), - NULL, + NULL }; int vnop_select_vp_offsets[] = { @@ -342,8 +307,7 @@ struct vnodeop_desc vnop_select_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_select_args, a_context), - VDESC_NO_OFFSET, - NULL, + NULL }; int vnop_exchange_vp_offsets[] = { @@ -361,7 +325,7 @@ struct vnodeop_desc vnop_exchange_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_exchange_args, a_context), - NULL, + NULL }; int vnop_kqfilt_add_vp_offsets[] = { @@ -378,7 +342,7 @@ struct vnodeop_desc vnop_kqfilt_add_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_kqfilt_add_args, a_context), - NULL, + NULL }; int vnop_kqfilt_remove_vp_offsets[] = { @@ -395,6 +359,23 @@ struct vnodeop_desc vnop_kqfilt_remove_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_kqfilt_remove_args, a_context), + NULL +}; + +int vnop_setlabel_vp_offsets[] = { + VOPARG_OFFSETOF(struct vnop_setlabel_args,a_vp), + VDESC_NO_OFFSET +}; +struct vnodeop_desc vnop_setlabel_desc = { + 0, + "vnop_setlabel", + 0, + vnop_setlabel_vp_offsets, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VOPARG_OFFSETOF(struct vnop_setlabel_args, a_context), NULL, }; @@ -411,7 +392,8 @@ struct vnodeop_desc vnop_revoke_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; @@ -428,7 +410,8 @@ struct vnodeop_desc vnop_mmap_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; @@ -445,7 +428,8 @@ struct vnodeop_desc vnop_mnomap_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; @@ -463,7 +447,7 @@ struct vnodeop_desc vnop_fsync_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_fsync_args, a_context), - NULL, + NULL }; int vnop_remove_vp_offsets[] = { @@ -481,7 +465,7 @@ struct vnodeop_desc vnop_remove_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_remove_args, a_cnp), VOPARG_OFFSETOF(struct vnop_remove_args, a_context), - NULL, + NULL }; int vnop_link_vp_offsets[] = { @@ -499,7 +483,7 @@ struct vnodeop_desc vnop_link_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_link_args, a_cnp), VOPARG_OFFSETOF(struct vnop_link_args, a_context), - NULL, + NULL }; int vnop_rename_vp_offsets[] = { @@ -519,7 +503,7 @@ struct vnodeop_desc vnop_rename_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_rename_args, a_fcnp), VOPARG_OFFSETOF(struct vnop_rename_args, a_context), - NULL, + NULL }; int vnop_mkdir_vp_offsets[] = { @@ -536,7 +520,7 @@ struct vnodeop_desc vnop_mkdir_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_mkdir_args, a_cnp), VOPARG_OFFSETOF(struct vnop_mkdir_args, a_context), - NULL, + NULL }; int vnop_rmdir_vp_offsets[] = { @@ -554,7 +538,7 @@ struct vnodeop_desc vnop_rmdir_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_rmdir_args, a_cnp), VOPARG_OFFSETOF(struct vnop_rmdir_args, a_context), - NULL, + NULL }; int vnop_symlink_vp_offsets[] = { @@ -571,7 +555,7 @@ struct vnodeop_desc vnop_symlink_desc = { VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_symlink_args, a_cnp), VOPARG_OFFSETOF(struct vnop_symlink_args, a_context), - NULL, + NULL }; int vnop_readdir_vp_offsets[] = { @@ -588,7 +572,7 @@ struct vnodeop_desc vnop_readdir_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_symlink_args, a_context), - NULL, + NULL }; int vnop_readdirattr_vp_offsets[] = { @@ -605,7 +589,7 @@ struct vnodeop_desc vnop_readdirattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_readdirattr_args, a_context), - NULL, + NULL }; int vnop_readlink_vp_offsets[] = { @@ -622,7 +606,7 @@ struct vnodeop_desc vnop_readlink_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_readlink_args, a_context), - NULL, + NULL }; int vnop_inactive_vp_offsets[] = { @@ -639,7 +623,7 @@ struct vnodeop_desc vnop_inactive_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_inactive_args, a_context), - NULL, + NULL }; int vnop_reclaim_vp_offsets[] = { @@ -656,7 +640,7 @@ struct vnodeop_desc vnop_reclaim_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_reclaim_args, a_context), - NULL, + NULL }; int vnop_pathconf_vp_offsets[] = { @@ -673,7 +657,7 @@ struct vnodeop_desc vnop_pathconf_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_pathconf_args, a_context), - NULL, + NULL }; int vnop_advlock_vp_offsets[] = { @@ -690,7 +674,7 @@ struct vnodeop_desc vnop_advlock_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_advlock_args, a_context), - NULL, + NULL }; int vnop_allocate_vp_offsets[] = { @@ -707,7 +691,7 @@ struct vnodeop_desc vnop_allocate_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_allocate_args, a_context), - NULL, + NULL }; int vnop_pagein_vp_offsets[] = { @@ -724,7 +708,7 @@ struct vnodeop_desc vnop_pagein_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_pagein_args, a_context), - NULL, + NULL }; int vnop_pageout_vp_offsets[] = { @@ -741,23 +725,7 @@ struct vnodeop_desc vnop_pageout_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_pageout_args, a_context), - NULL, -}; - -int vnop_devblocksize_vp_offsets[] = { - VOPARG_OFFSETOF(struct vnop_devblocksize_args,a_vp), - VDESC_NO_OFFSET -}; -struct vnodeop_desc vnop_devblocksize_desc = { - 0, - "vnop_devblocksize", - 0, - vnop_devblocksize_vp_offsets, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - VDESC_NO_OFFSET, - NULL, + NULL }; int vnop_searchfs_vp_offsets[] = { @@ -773,7 +741,8 @@ struct vnodeop_desc vnop_searchfs_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; int vnop_copyfile_vp_offsets[] = { @@ -791,7 +760,8 @@ struct vnodeop_desc vnop_copyfile_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_copyfile_args, a_tcnp), - NULL, + VDESC_NO_OFFSET, + NULL }; int vop_getxattr_vp_offsets[] = { @@ -808,7 +778,7 @@ struct vnodeop_desc vnop_getxattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_getxattr_args, a_context), - NULL, + NULL }; int vop_setxattr_vp_offsets[] = { @@ -825,7 +795,7 @@ struct vnodeop_desc vnop_setxattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_setxattr_args, a_context), - NULL, + NULL }; int vop_removexattr_vp_offsets[] = { @@ -842,7 +812,7 @@ struct vnodeop_desc vnop_removexattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_removexattr_args, a_context), - NULL, + NULL }; int vop_listxattr_vp_offsets[] = { @@ -859,7 +829,7 @@ struct vnodeop_desc vnop_listxattr_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vnop_listxattr_args, a_context), - NULL, + NULL }; int vnop_blktooff_vp_offsets[] = { @@ -875,7 +845,8 @@ struct vnodeop_desc vnop_blktooff_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; int vnop_offtoblk_vp_offsets[] = { @@ -891,7 +862,8 @@ struct vnodeop_desc vnop_offtoblk_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; int vnop_blockmap_vp_offsets[] = { @@ -907,8 +879,67 @@ struct vnodeop_desc vnop_blockmap_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL +}; + +#if NAMEDSTREAMS +int vnop_getnamedstream_vp_offsets[] = { + VOPARG_OFFSETOF(struct vnop_getnamedstream_args, a_vp), + VDESC_NO_OFFSET +}; +struct vnodeop_desc vnop_getnamedstream_desc = { + 0, + "vnop_getnamedstream", + 0, + vnop_getnamedstream_vp_offsets, + VOPARG_OFFSETOF(struct vnop_getnamedstream_args, a_svpp), + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VOPARG_OFFSETOF(struct vnop_getnamedstream_args, a_name), + VOPARG_OFFSETOF(struct vnop_getnamedstream_args, a_context), + NULL +}; + +int vnop_makenamedstream_vp_offsets[] = { + VOPARG_OFFSETOF(struct vnop_makenamedstream_args, a_vp), + VDESC_NO_OFFSET +}; +struct vnodeop_desc vnop_makenamedstream_desc = { + 0, + "vnop_makenamedstream", + 0, /* flags */ + vnop_makenamedstream_vp_offsets, + VOPARG_OFFSETOF(struct vnop_makenamedstream_args, a_svpp), + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VOPARG_OFFSETOF(struct vnop_makenamedstream_args, a_name), + VOPARG_OFFSETOF(struct vnop_makenamedstream_args, a_context), + NULL +}; + +int vnop_removenamedstream_vp_offsets[] = { + VOPARG_OFFSETOF(struct vnop_removenamedstream_args, a_vp), + VDESC_NO_OFFSET +}; +struct vnodeop_desc vnop_removenamedstream_desc = { + 0, + "vnop_removenamedstream", + 0, + vnop_removenamedstream_vp_offsets, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VDESC_NO_OFFSET, + VOPARG_OFFSETOF(struct vnop_removenamedstream_args, a_name), + VOPARG_OFFSETOF(struct vnop_removenamedstream_args, a_context), + NULL }; +#else +/* These symbols are in the exports list so they need to always be defined. */ +int vnop_getnamedstream_desc; +int vnop_makenamedstream_desc; +int vnop_removenamedstream_desc; +#endif /* Special cases: */ @@ -924,7 +955,8 @@ struct vnodeop_desc vnop_strategy_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; int vnop_bwrite_vp_offsets[] = { @@ -939,7 +971,8 @@ struct vnodeop_desc vnop_bwrite_desc = { VDESC_NO_OFFSET, VDESC_NO_OFFSET, VDESC_NO_OFFSET, - NULL, + VDESC_NO_OFFSET, + NULL }; /* End of special cases. */ @@ -958,8 +991,6 @@ struct vnodeop_desc *vfs_op_descs[] = { &vnop_access_desc, &vnop_getattr_desc, &vnop_setattr_desc, - &vnop_getattrlist_desc, - &vnop_setattrlist_desc, &vnop_read_desc, &vnop_write_desc, &vnop_ioctl_desc, @@ -967,6 +998,7 @@ struct vnodeop_desc *vfs_op_descs[] = { &vnop_exchange_desc, &vnop_kqfilt_add_desc, &vnop_kqfilt_remove_desc, + &vnop_setlabel_desc, &vnop_revoke_desc, &vnop_mmap_desc, &vnop_mnomap_desc, @@ -987,7 +1019,6 @@ struct vnodeop_desc *vfs_op_descs[] = { &vnop_allocate_desc, &vnop_pagein_desc, &vnop_pageout_desc, - &vnop_devblocksize_desc, &vnop_searchfs_desc, &vnop_copyfile_desc, &vnop_getxattr_desc, @@ -997,6 +1028,11 @@ struct vnodeop_desc *vfs_op_descs[] = { &vnop_blktooff_desc, &vnop_offtoblk_desc, &vnop_blockmap_desc, +#if NAMEDSTREAMS + &vnop_getnamedstream_desc, + &vnop_makenamedstream_desc, + &vnop_removenamedstream_desc, +#endif NULL };