X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/ff6e181ae92fc6f1e89841290f461d1f2f9badd9..e8c3f78193f1895ea514044358b93b1add9322f3:/bsd/vfs/vfs_support.c diff --git a/bsd/vfs/vfs_support.c b/bsd/vfs/vfs_support.c index 7ae41ca23..ed146fa8f 100644 --- a/bsd/vfs/vfs_support.c +++ b/bsd/vfs/vfs_support.c @@ -1,14 +1,19 @@ /* * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ + * @APPLE_OSREFERENCE_LICENSE_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. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * 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 @@ -18,7 +23,7 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1998-1999 Apple Computer, Inc. All rights reserved. @@ -45,6 +50,7 @@ #include #include +#include /* ubc_upl_abort_range() */ struct vnop_create_args /* { @@ -56,7 +62,7 @@ struct vnop_create_args /* { } */; int -nop_create(struct vnop_create_args *ap) +nop_create(__unused struct vnop_create_args *ap) { #if DIAGNOSTIC if ((ap->a_cnp->cn_flags & HASBUF) == 0) @@ -81,13 +87,13 @@ struct vnop_whiteout_args /* { } */; int -nop_whiteout(struct vnop_whiteout_args *ap) +nop_whiteout(__unused struct vnop_whiteout_args *ap) { return (0); } int -err_whiteout(struct vnop_whiteout_args *ap) +err_whiteout(__unused struct vnop_whiteout_args *ap) { return (ENOTSUP); } @@ -102,7 +108,7 @@ struct vnop_mknod_args /* { } */; int -nop_mknod(struct vnop_mknod_args *ap) +nop_mknod(__unused struct vnop_mknod_args *ap) { #if DIAGNOSTIC if ((ap->a_cnp->cn_flags & HASBUF) == 0) @@ -125,13 +131,13 @@ struct vnop_open_args /* { } */; int -nop_open(struct vnop_open_args *ap) +nop_open(__unused struct vnop_open_args *ap) { return (0); } int -err_open(struct vnop_open_args *ap) +err_open(__unused struct vnop_open_args *ap) { return (ENOTSUP); } @@ -144,13 +150,13 @@ struct vnop_close_args /* { } */; int -nop_close(struct vnop_close_args *ap) +nop_close(__unused struct vnop_close_args *ap) { return (0); } int -err_close(struct vnop_close_args *ap) +err_close(__unused struct vnop_close_args *ap) { return (ENOTSUP); } @@ -163,13 +169,13 @@ struct vnop_access_args /* { } */; int -nop_access(struct vnop_access_args *ap) +nop_access(__unused struct vnop_access_args *ap) { return (0); } int -err_access(struct vnop_access_args *ap) +err_access(__unused struct vnop_access_args *ap) { return (ENOTSUP); } @@ -182,13 +188,13 @@ struct vnop_getattr_args /* { } */; int -nop_getattr(struct vnop_getattr_args *ap) +nop_getattr(__unused struct vnop_getattr_args *ap) { return (0); } int -err_getattr(struct vnop_getattr_args *ap) +err_getattr(__unused struct vnop_getattr_args *ap) { return (ENOTSUP); } @@ -201,60 +207,17 @@ struct vnop_setattr_args /* { } */; int -nop_setattr(struct vnop_setattr_args *ap) -{ - return (0); -} - -int -err_setattr(struct vnop_setattr_args *ap) -{ - return (ENOTSUP); -} - - -struct vnop_getattrlist_args /* { - struct vnode *a_vp; - struct attrlist *a_alist; - struct uio *a_uio; - int a_options; - vfs_context a_context; -} */; - -int -nop_getattrlist(struct vnop_getattrlist_args *ap) +nop_setattr(__unused struct vnop_setattr_args *ap) { return (0); } int -err_getattrlist(struct vnop_getattrlist_args *ap) +err_setattr(__unused struct vnop_setattr_args *ap) { return (ENOTSUP); } - -struct vnop_setattrlist_args /* { - struct vnode *a_vp; - struct attrlist *a_alist; - struct uio *a_uio; - int a_options; - vfs_context_t a_context; -} */; - -int -nop_setattrlist(struct vnop_setattrlist_args *ap) -{ - return (0); -} - -int -err_setattrlist(struct vnop_setattrlist_args *ap) -{ - return (ENOTSUP); -} - - struct vnop_read_args /* { struct vnode *a_vp; struct uio *a_uio; @@ -263,13 +226,13 @@ struct vnop_read_args /* { } */; int -nop_read(struct vnop_read_args *ap) +nop_read(__unused struct vnop_read_args *ap) { return (0); } int -err_read(struct vnop_read_args *ap) +err_read(__unused struct vnop_read_args *ap) { return (ENOTSUP); } @@ -283,13 +246,13 @@ struct vnop_write_args /* { } */; int -nop_write(struct vnop_write_args *ap) +nop_write(__unused struct vnop_write_args *ap) { return (0); } int -err_write(struct vnop_write_args *ap) +err_write(__unused struct vnop_write_args *ap) { return (ENOTSUP); } @@ -311,7 +274,7 @@ nop_ioctl(__unused struct vnop_ioctl_args *ap) } int -err_ioctl(struct vnop_ioctl_args *ap) +err_ioctl(__unused struct vnop_ioctl_args *ap) { return (ENOTSUP); } @@ -333,7 +296,7 @@ nop_select(__unused struct vnop_select_args *ap) } int -err_select(struct vnop_select_args *ap) +err_select(__unused struct vnop_select_args *ap) { return (ENOTSUP); } @@ -347,13 +310,13 @@ struct vnop_exchange_args /* { } */; int -nop_exchange(struct vnop_exchange_args *ap) +nop_exchange(__unused struct vnop_exchange_args *ap) { return (0); } int -err_exchange(struct vnop_exchange_args *ap) +err_exchange(__unused struct vnop_exchange_args *ap) { return (ENOTSUP); } @@ -393,7 +356,7 @@ nop_mmap(__unused struct vnop_mmap_args *ap) } int -err_mmap(struct vnop_mmap_args *ap) +err_mmap(__unused struct vnop_mmap_args *ap) { return (ENOTSUP); } @@ -406,13 +369,13 @@ struct vnop_fsync_args /* { } */; int -nop_fsync(struct vnop_fsync_args *ap) +nop_fsync(__unused struct vnop_fsync_args *ap) { return (0); } int -err_fsync(struct vnop_fsync_args *ap) +err_fsync(__unused struct vnop_fsync_args *ap) { return (ENOTSUP); } @@ -427,7 +390,7 @@ struct vnop_remove_args /* { } */; int -nop_remove(struct vnop_remove_args *ap) +nop_remove(__unused struct vnop_remove_args *ap) { return (0); } @@ -448,7 +411,7 @@ struct vnop_link_args /* { } */; int -nop_link(struct vnop_link_args *ap) +nop_link(__unused struct vnop_link_args *ap) { return (0); } @@ -472,7 +435,7 @@ struct vnop_rename_args /* { } */; int -nop_rename(struct vnop_rename_args *ap) +nop_rename(__unused struct vnop_rename_args *ap) { return (0); } @@ -494,13 +457,13 @@ struct vnop_mkdir_args /* { } */; int -nop_mkdir(struct vnop_mkdir_args *ap) +nop_mkdir(__unused struct vnop_mkdir_args *ap) { return (0); } int -err_mkdir(struct vnop_mkdir_args *ap) +err_mkdir(__unused struct vnop_mkdir_args *ap) { return (ENOTSUP); } @@ -514,7 +477,7 @@ struct vnop_rmdir_args /* { } */; int -nop_rmdir(struct vnop_rmdir_args *ap) +nop_rmdir(__unused struct vnop_rmdir_args *ap) { return (0); } @@ -537,7 +500,7 @@ struct vnop_symlink_args /* { } */; int -nop_symlink(struct vnop_symlink_args *ap) +nop_symlink(__unused struct vnop_symlink_args *ap) { #if DIAGNOSTIC if ((ap->a_cnp->cn_flags & HASBUF) == 0) @@ -564,29 +527,30 @@ struct vnop_readdir_args /* { } */; int -nop_readdir(struct vnop_readdir_args *ap) +nop_readdir(__unused struct vnop_readdir_args *ap) { return (0); } int -err_readdir(struct vnop_readdir_args *ap) +err_readdir(__unused struct vnop_readdir_args *ap) { return (ENOTSUP); } struct vnop_readdirattr_args /* { - struct vnode *a_vp; + struct vnodeop_desc *a_desc; + vnode_t a_vp; struct attrlist *a_alist; struct uio *a_uio; u_long a_maxcount; - u_long a_options; - int *a_newstate; + u_long a_options; + u_long *a_newstate; int *a_eofflag; - u_long *a_actualcount; + u_long *a_actualcount; vfs_context_t a_context; -} */; +} */ ; int nop_readdirattr(struct vnop_readdirattr_args *ap) @@ -611,13 +575,13 @@ struct vnop_readlink_args /* { } */; int -nop_readlink(struct vnop_readlink_args *ap) +nop_readlink(__unused struct vnop_readlink_args *ap) { return (0); } int -err_readlink(struct vnop_readlink_args *ap) +err_readlink(__unused struct vnop_readlink_args *ap) { return (ENOTSUP); } @@ -629,7 +593,7 @@ struct vnop_inactive_args /* { } */; int -nop_inactive(struct vnop_inactive_args *ap) +nop_inactive(__unused struct vnop_inactive_args *ap) { return (0); } @@ -648,13 +612,13 @@ struct vnop_reclaim_args /* { } */; int -nop_reclaim(struct vnop_reclaim_args *ap) +nop_reclaim(__unused struct vnop_reclaim_args *ap) { return (0); } int -err_reclaim(struct vnop_reclaim_args *ap) +err_reclaim(__unused struct vnop_reclaim_args *ap) { return (ENOTSUP); } @@ -665,13 +629,13 @@ struct vnop_strategy_args /* { } */; int -nop_strategy(struct vnop_strategy_args *ap) +nop_strategy(__unused struct vnop_strategy_args *ap) { return (0); } int -err_strategy(struct vnop_strategy_args *ap) +err_strategy(__unused struct vnop_strategy_args *ap) { return (ENOTSUP); } @@ -680,18 +644,18 @@ err_strategy(struct vnop_strategy_args *ap) struct vnop_pathconf_args /* { struct vnode *a_vp; int a_name; - register_t *a_retval; + int32_t *a_retval; vfs_context_t a_context; } */; int -nop_pathconf(struct vnop_pathconf_args *ap) +nop_pathconf(__unused struct vnop_pathconf_args *ap) { return (0); } int -err_pathconf(struct vnop_pathconf_args *ap) +err_pathconf(__unused struct vnop_pathconf_args *ap) { return (ENOTSUP); } @@ -707,13 +671,13 @@ struct vnop_advlock_args /* { } */; int -nop_advlock(struct vnop_advlock_args *ap) +nop_advlock(__unused struct vnop_advlock_args *ap) { return (0); } int -err_advlock(struct vnop_advlock_args *ap) +err_advlock(__unused struct vnop_advlock_args *ap) { return (ENOTSUP); } @@ -754,7 +718,7 @@ nop_bwrite(struct vnop_bwrite_args *ap) } int -err_bwrite(struct vnop_bwrite_args *ap) +err_bwrite(__unused struct vnop_bwrite_args *ap) { return (ENOTSUP); } @@ -814,27 +778,6 @@ err_pageout(struct vnop_pageout_args *ap) } -struct vnop_devblocksize_args /* { - struct vnode *a_vp; - register_t *a_retval; -} */; - -int -nop_devblocksize(struct vnop_devblocksize_args *ap) -{ - /* XXX default value because the call sites do not check error */ - *ap->a_retval = 512; - return (0); -} - -int -err_devblocksize(struct vnop_devblocksize_args *ap) -{ - (void)nop_devblocksize(ap); - return (ENOTSUP); -} - - struct vnop_searchfs /* { struct vnode *a_vp; void *a_searchparams1; @@ -875,7 +818,7 @@ struct vnop_copyfile_args /*{ }*/; int -nop_copyfile(struct vnop_copyfile_args *ap) +nop_copyfile(__unused struct vnop_copyfile_args *ap) { return (0); } @@ -939,12 +882,12 @@ struct vnop_blockmap_args /* { int a_flags; } */; -int nop_blockmap(struct vnop_blockmap_args *ap) +int nop_blockmap(__unused struct vnop_blockmap_args *ap) { return (0); } -int err_blockmap(struct vnop_blockmap_args *ap) +int err_blockmap(__unused struct vnop_blockmap_args *ap) { return (ENOTSUP); }