diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 6a719a844b47..8485a20ffb75 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 - * $Id: cd9660_vnops.c,v 1.45 1997/10/16 20:32:21 phk Exp $ + * $Id: cd9660_vnops.c,v 1.46 1997/10/17 12:36:11 phk Exp $ */ #include @@ -812,7 +812,7 @@ cd9660_pathconf(ap) */ vop_t **cd9660_vnodeop_p; struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) cd9660_abortop }, { &vop_access_desc, (vop_t *) cd9660_access }, { &vop_bmap_desc, (vop_t *) cd9660_bmap }, diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index c4bc9dc51ae2..6888f35d6aa9 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: dead_vnops.c,v 1.19 1997/10/16 20:32:24 phk Exp $ + * $Id: dead_vnops.c,v 1.20 1997/10/16 21:59:55 phk Exp $ */ #include @@ -45,7 +45,6 @@ static int chkvnlock __P((struct vnode *)); * Prototypes for dead operations on vnodes. */ static int dead_badop __P((void)); -static int dead_ebadf __P((void)); static int dead_lookup __P((struct vop_lookup_args *)); static int dead_open __P((struct vop_open_args *)); static int dead_read __P((struct vop_read_args *)); @@ -57,13 +56,13 @@ static int dead_print __P((struct vop_print_args *)); vop_t **dead_vnodeop_p; static struct vnodeopv_entry_desc dead_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) dead_ebadf }, - { &vop_advlock_desc, (vop_t *) dead_ebadf }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_ebadf }, + { &vop_advlock_desc, (vop_t *) vop_ebadf }, { &vop_bmap_desc, (vop_t *) dead_bmap }, { &vop_create_desc, (vop_t *) dead_badop }, - { &vop_getattr_desc, (vop_t *) dead_ebadf }, - { &vop_inactive_desc, (vop_t *) nullop }, + { &vop_getattr_desc, (vop_t *) vop_ebadf }, + { &vop_inactive_desc, (vop_t *) vop_null }, { &vop_ioctl_desc, (vop_t *) dead_ioctl }, { &vop_link_desc, (vop_t *) dead_badop }, { &vop_lock_desc, (vop_t *) dead_lock }, @@ -72,16 +71,16 @@ static struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_mknod_desc, (vop_t *) dead_badop }, { &vop_mmap_desc, (vop_t *) dead_badop }, { &vop_open_desc, (vop_t *) dead_open }, - { &vop_pathconf_desc, (vop_t *) dead_ebadf }, /* per pathconf(2) */ + { &vop_pathconf_desc, (vop_t *) vop_ebadf }, /* per pathconf(2) */ { &vop_print_desc, (vop_t *) dead_print }, { &vop_read_desc, (vop_t *) dead_read }, - { &vop_readdir_desc, (vop_t *) dead_ebadf }, - { &vop_readlink_desc, (vop_t *) dead_ebadf }, - { &vop_reclaim_desc, (vop_t *) nullop }, + { &vop_readdir_desc, (vop_t *) vop_ebadf }, + { &vop_readlink_desc, (vop_t *) vop_ebadf }, + { &vop_reclaim_desc, (vop_t *) vop_null }, { &vop_remove_desc, (vop_t *) dead_badop }, { &vop_rename_desc, (vop_t *) dead_badop }, { &vop_rmdir_desc, (vop_t *) dead_badop }, - { &vop_setattr_desc, (vop_t *) dead_ebadf }, + { &vop_setattr_desc, (vop_t *) vop_ebadf }, { &vop_symlink_desc, (vop_t *) dead_badop }, { &vop_write_desc, (vop_t *) dead_write }, { NULL, NULL } @@ -260,16 +259,6 @@ dead_print(ap) return (0); } -/* - * Empty vnode failed operation - */ -static int -dead_ebadf() -{ - - return (EBADF); -} - /* * Empty vnode bad operation */ diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 8650eb650bcd..d92d429e00ad 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.30 1997/10/16 20:32:25 phk Exp $ + * $Id: fdesc_vnops.c,v 1.31 1997/10/16 22:00:05 phk Exp $ */ /* @@ -856,8 +856,8 @@ fdesc_badop() } static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) nullop }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_null }, { &vop_bmap_desc, (vop_t *) fdesc_badop }, { &vop_getattr_desc, (vop_t *) fdesc_getattr }, { &vop_inactive_desc, (vop_t *) fdesc_inactive }, diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 20fb82869e29..9074a1f8d4d2 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 - * $Id: fifo_vnops.c,v 1.33 1997/10/16 20:32:26 phk Exp $ + * $Id: fifo_vnops.c,v 1.34 1997/10/16 22:00:12 phk Exp $ */ #include @@ -60,7 +60,6 @@ struct fifoinfo { long fi_writers; }; -static int fifo_ebadf __P((void)); static int fifo_badop __P((void)); static int fifo_print __P((struct vop_print_args *)); static int fifo_lookup __P((struct vop_lookup_args *)); @@ -77,17 +76,17 @@ static int fifo_advlock __P((struct vop_advlock_args *)); vop_t **fifo_vnodeop_p; static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) fifo_badop }, - { &vop_access_desc, (vop_t *) fifo_ebadf }, + { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) fifo_advlock }, { &vop_bmap_desc, (vop_t *) fifo_bmap }, { &vop_close_desc, (vop_t *) fifo_close }, { &vop_create_desc, (vop_t *) fifo_badop }, - { &vop_getattr_desc, (vop_t *) fifo_ebadf }, + { &vop_getattr_desc, (vop_t *) vop_ebadf }, { &vop_inactive_desc, (vop_t *) fifo_inactive }, { &vop_ioctl_desc, (vop_t *) fifo_ioctl }, - { &vop_lease_desc, (vop_t *) nullop }, + { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) fifo_badop }, { &vop_lookup_desc, (vop_t *) fifo_lookup }, { &vop_mkdir_desc, (vop_t *) fifo_badop }, @@ -100,11 +99,11 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_readdir_desc, (vop_t *) fifo_badop }, { &vop_readlink_desc, (vop_t *) fifo_badop }, { &vop_reallocblks_desc, (vop_t *) fifo_badop }, - { &vop_reclaim_desc, (vop_t *) nullop }, + { &vop_reclaim_desc, (vop_t *) vop_null }, { &vop_remove_desc, (vop_t *) fifo_badop }, { &vop_rename_desc, (vop_t *) fifo_badop }, { &vop_rmdir_desc, (vop_t *) fifo_badop }, - { &vop_setattr_desc, (vop_t *) fifo_ebadf }, + { &vop_setattr_desc, (vop_t *) vop_ebadf }, { &vop_symlink_desc, (vop_t *) fifo_badop }, { &vop_write_desc, (vop_t *) fifo_write }, { NULL, NULL } @@ -484,16 +483,6 @@ fifo_print(ap) return (0); } -/* - * Fifo failed operation - */ -static int -fifo_ebadf() -{ - - return (EBADF); -} - /* * Fifo advisory byte-level locks. */ diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index d228f4951e4b..1b9cc4ea3d36 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.49 1997/10/16 20:32:31 phk Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.50 1997/10/17 12:36:17 phk Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -1833,7 +1833,7 @@ msdosfs_pathconf(ap) /* Global vfs data structures for msdosfs */ vop_t **msdosfs_vnodeop_p; static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) msdosfs_abortop }, { &vop_access_desc, (vop_t *) msdosfs_access }, { &vop_bmap_desc, (vop_t *) msdosfs_bmap }, diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c index 6e3745c17ee3..bcd24a8648a2 100644 --- a/sys/fs/portalfs/portal_vnops.c +++ b/sys/fs/portalfs/portal_vnops.c @@ -35,7 +35,7 @@ * * @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95 * - * $Id: portal_vnops.c,v 1.25 1997/10/16 20:32:27 phk Exp $ + * $Id: portal_vnops.c,v 1.26 1997/10/16 22:00:27 phk Exp $ */ /* @@ -598,8 +598,8 @@ portal_badop() vop_t **portal_vnodeop_p; static struct vnodeopv_entry_desc portal_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) nullop }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_null }, { &vop_bmap_desc, (vop_t *) portal_badop }, { &vop_getattr_desc, (vop_t *) portal_getattr }, { &vop_inactive_desc, (vop_t *) portal_inactive }, diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index e439b13a0dce..ff8f90cd2d72 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.37 1997/10/16 20:32:28 phk Exp $ + * $Id: procfs_vnops.c,v 1.38 1997/10/16 22:00:36 phk Exp $ */ /* @@ -884,7 +884,7 @@ atopid(b, len) */ vop_t **procfs_vnodeop_p; static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) procfs_abortop }, { &vop_access_desc, (vop_t *) procfs_access }, { &vop_advlock_desc, (vop_t *) procfs_badop }, diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index bf9a24442d34..e01196f546d7 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.48 1997/10/16 20:32:29 phk Exp $ + * $Id: spec_vnops.c,v 1.49 1997/10/16 22:00:42 phk Exp $ */ #include @@ -58,7 +58,6 @@ #include -static int spec_ebadf __P((void)); static int spec_getattr __P((struct vop_getattr_args *)); static int spec_badop __P((void)); static int spec_strategy __P((struct vop_strategy_args *)); @@ -79,8 +78,8 @@ static int spec_getpages __P((struct vop_getpages_args *)); struct vnode *speclisth[SPECHSZ]; vop_t **spec_vnodeop_p; static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) spec_ebadf }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) spec_advlock }, { &vop_bmap_desc, (vop_t *) spec_bmap }, { &vop_close_desc, (vop_t *) spec_close }, @@ -90,7 +89,7 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_getpages_desc, (vop_t *) spec_getpages }, { &vop_inactive_desc, (vop_t *) spec_inactive }, { &vop_ioctl_desc, (vop_t *) spec_ioctl }, - { &vop_lease_desc, (vop_t *) nullop }, + { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) spec_badop }, { &vop_lookup_desc, (vop_t *) spec_lookup }, { &vop_mkdir_desc, (vop_t *) spec_badop }, @@ -103,11 +102,11 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_readdir_desc, (vop_t *) spec_badop }, { &vop_readlink_desc, (vop_t *) spec_badop }, { &vop_reallocblks_desc, (vop_t *) spec_badop }, - { &vop_reclaim_desc, (vop_t *) nullop }, + { &vop_reclaim_desc, (vop_t *) vop_null }, { &vop_remove_desc, (vop_t *) spec_badop }, { &vop_rename_desc, (vop_t *) spec_badop }, { &vop_rmdir_desc, (vop_t *) spec_badop }, - { &vop_setattr_desc, (vop_t *) spec_ebadf }, + { &vop_setattr_desc, (vop_t *) vop_ebadf }, { &vop_strategy_desc, (vop_t *) spec_strategy }, { &vop_symlink_desc, (vop_t *) spec_badop }, { &vop_write_desc, (vop_t *) spec_write }, @@ -696,16 +695,6 @@ spec_advlock(ap) return (ap->a_flags & F_FLOCK ? EOPNOTSUPP : EINVAL); } -/* - * Special device failed operation - */ -static int -spec_ebadf() -{ - - return (EBADF); -} - /* * Special device bad operation */ diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index e1c9a878a0cc..83dcb3ee6514 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.44 1997/10/15 10:04:54 phk Exp $ + * $Id: union_vnops.c,v 1.45 1997/10/16 20:32:30 phk Exp $ */ #include @@ -1739,7 +1739,7 @@ union_strategy(ap) */ vop_t **union_vnodeop_p; static struct vnodeopv_entry_desc union_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) union_abortop }, { &vop_access_desc, (vop_t *) union_access }, { &vop_advlock_desc, (vop_t *) union_advlock }, diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 6a719a844b47..8485a20ffb75 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 - * $Id: cd9660_vnops.c,v 1.45 1997/10/16 20:32:21 phk Exp $ + * $Id: cd9660_vnops.c,v 1.46 1997/10/17 12:36:11 phk Exp $ */ #include @@ -812,7 +812,7 @@ cd9660_pathconf(ap) */ vop_t **cd9660_vnodeop_p; struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) cd9660_abortop }, { &vop_access_desc, (vop_t *) cd9660_access }, { &vop_bmap_desc, (vop_t *) cd9660_bmap }, diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 0630a45b4f05..108ba71801ec 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.129 1997/10/11 18:31:26 phk Exp $ + * $Id: vfs_bio.c,v 1.130 1997/10/12 20:24:21 phk Exp $ */ /* @@ -397,13 +397,6 @@ bwrite(struct buf * bp) return (0); } -int -vn_bwrite(ap) - struct vop_bwrite_args *ap; -{ - return (bwrite(ap->a_bp)); -} - void vfs_bio_need_satisfy(void) { ++numfreebuffers; diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index f7aaf9b68d06..a8f685efd27a 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -40,9 +40,11 @@ #include #include #include +#include #include #include #include +#include static int vop_nostrategy __P((struct vop_strategy_args *)); @@ -57,9 +59,9 @@ static int vop_nostrategy __P((struct vop_strategy_args *)); vop_t **default_vnodeop_p; static struct vnodeopv_entry_desc default_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_eopnotsupp }, - { &vop_abortop_desc, (vop_t *) nullop }, + { &vop_abortop_desc, (vop_t *) vop_null }, { &vop_advlock_desc, (vop_t *) vop_einval }, - { &vop_bwrite_desc, (vop_t *) vn_bwrite }, + { &vop_bwrite_desc, (vop_t *) vop_stdbwrite }, { &vop_close_desc, (vop_t *) vop_null }, { &vop_fsync_desc, (vop_t *) vop_null }, { &vop_ioctl_desc, (vop_t *) vop_enotty }, @@ -217,3 +219,204 @@ vop_stdislocked(ap) return (lockstatus(l)); } +/* + * Return true for select/poll. + */ +int +vop_nopoll(ap) + struct vop_poll_args /* { + struct vnode *a_vp; + int a_events; + struct ucred *a_cred; + struct proc *a_p; + } */ *ap; +{ + + /* + * Just return what we were asked for. + */ + return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); +} + +int +vop_stdbwrite(ap) + struct vop_bwrite_args *ap; +{ + return (bwrite(ap->a_bp)); +} + +/* + * Stubs to use when there is no locking to be done on the underlying object. + * A minimal shared lock is necessary to ensure that the underlying object + * is not revoked while an operation is in progress. So, an active shared + * count is maintained in an auxillary vnode lock structure. + */ +int +vop_sharedlock(ap) + struct vop_lock_args /* { + struct vnode *a_vp; + int a_flags; + struct proc *a_p; + } */ *ap; +{ + /* + * This code cannot be used until all the non-locking filesystems + * (notably NFS) are converted to properly lock and release nodes. + * Also, certain vnode operations change the locking state within + * the operation (create, mknod, remove, link, rename, mkdir, rmdir, + * and symlink). Ideally these operations should not change the + * lock state, but should be changed to let the caller of the + * function unlock them. Otherwise all intermediate vnode layers + * (such as union, umapfs, etc) must catch these functions to do + * the necessary locking at their layer. Note that the inactive + * and lookup operations also change their lock state, but this + * cannot be avoided, so these two operations will always need + * to be handled in intermediate layers. + */ + struct vnode *vp = ap->a_vp; + int vnflags, flags = ap->a_flags; + + if (vp->v_vnlock == NULL) { + if ((flags & LK_TYPE_MASK) == LK_DRAIN) + return (0); + MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock), + M_VNODE, M_WAITOK); + lockinit(vp->v_vnlock, PVFS, "vnlock", 0, 0); + } + switch (flags & LK_TYPE_MASK) { + case LK_DRAIN: + vnflags = LK_DRAIN; + break; + case LK_EXCLUSIVE: +#ifdef DEBUG_VFS_LOCKS + /* + * Normally, we use shared locks here, but that confuses + * the locking assertions. + */ + vnflags = LK_EXCLUSIVE; + break; +#endif + case LK_SHARED: + vnflags = LK_SHARED; + break; + case LK_UPGRADE: + case LK_EXCLUPGRADE: + case LK_DOWNGRADE: + return (0); + case LK_RELEASE: + default: + panic("vop_sharedlock: bad operation %d", flags & LK_TYPE_MASK); + } + if (flags & LK_INTERLOCK) + vnflags |= LK_INTERLOCK; + return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p)); +} + +/* + * Stubs to use when there is no locking to be done on the underlying object. + * A minimal shared lock is necessary to ensure that the underlying object + * is not revoked while an operation is in progress. So, an active shared + * count is maintained in an auxillary vnode lock structure. + */ +int +vop_nolock(ap) + struct vop_lock_args /* { + struct vnode *a_vp; + int a_flags; + struct proc *a_p; + } */ *ap; +{ +#ifdef notyet + /* + * This code cannot be used until all the non-locking filesystems + * (notably NFS) are converted to properly lock and release nodes. + * Also, certain vnode operations change the locking state within + * the operation (create, mknod, remove, link, rename, mkdir, rmdir, + * and symlink). Ideally these operations should not change the + * lock state, but should be changed to let the caller of the + * function unlock them. Otherwise all intermediate vnode layers + * (such as union, umapfs, etc) must catch these functions to do + * the necessary locking at their layer. Note that the inactive + * and lookup operations also change their lock state, but this + * cannot be avoided, so these two operations will always need + * to be handled in intermediate layers. + */ + struct vnode *vp = ap->a_vp; + int vnflags, flags = ap->a_flags; + + if (vp->v_vnlock == NULL) { + if ((flags & LK_TYPE_MASK) == LK_DRAIN) + return (0); + MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock), + M_VNODE, M_WAITOK); + lockinit(vp->v_vnlock, PVFS, "vnlock", 0, 0); + } + switch (flags & LK_TYPE_MASK) { + case LK_DRAIN: + vnflags = LK_DRAIN; + break; + case LK_EXCLUSIVE: + case LK_SHARED: + vnflags = LK_SHARED; + break; + case LK_UPGRADE: + case LK_EXCLUPGRADE: + case LK_DOWNGRADE: + return (0); + case LK_RELEASE: + default: + panic("vop_nolock: bad operation %d", flags & LK_TYPE_MASK); + } + if (flags & LK_INTERLOCK) + vnflags |= LK_INTERLOCK; + return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p)); +#else /* for now */ + /* + * Since we are not using the lock manager, we must clear + * the interlock here. + */ + if (ap->a_flags & LK_INTERLOCK) { + simple_unlock(&ap->a_vp->v_interlock); + } + return (0); +#endif +} + +/* + * Do the inverse of vop_nolock, handling the interlock in a compatible way. + */ +int +vop_nounlock(ap) + struct vop_unlock_args /* { + struct vnode *a_vp; + int a_flags; + struct proc *a_p; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + + if (vp->v_vnlock == NULL) { + if (ap->a_flags & LK_INTERLOCK) + simple_unlock(&ap->a_vp->v_interlock); + return (0); + } + return (lockmgr(vp->v_vnlock, LK_RELEASE | ap->a_flags, + &ap->a_vp->v_interlock, ap->a_p)); +} + +/* + * Return whether or not the node is in use. + */ +int +vop_noislocked(ap) + struct vop_islocked_args /* { + struct vnode *a_vp; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + + if (vp->v_vnlock == NULL) + return (0); + return (lockstatus(vp->v_vnlock)); +} + diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 03c64d259f45..ebc4dc3ecfa3 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.109 1997/10/11 18:31:26 phk Exp $ + * $Id: vfs_subr.c,v 1.110 1997/10/12 20:24:26 phk Exp $ */ /* @@ -867,182 +867,6 @@ vget(vp, flags, p) simple_unlock(&vp->v_interlock); return (0); } - -/* - * Stubs to use when there is no locking to be done on the underlying object. - * A minimal shared lock is necessary to ensure that the underlying object - * is not revoked while an operation is in progress. So, an active shared - * count is maintained in an auxillary vnode lock structure. - */ -int -vop_sharedlock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ - /* - * This code cannot be used until all the non-locking filesystems - * (notably NFS) are converted to properly lock and release nodes. - * Also, certain vnode operations change the locking state within - * the operation (create, mknod, remove, link, rename, mkdir, rmdir, - * and symlink). Ideally these operations should not change the - * lock state, but should be changed to let the caller of the - * function unlock them. Otherwise all intermediate vnode layers - * (such as union, umapfs, etc) must catch these functions to do - * the necessary locking at their layer. Note that the inactive - * and lookup operations also change their lock state, but this - * cannot be avoided, so these two operations will always need - * to be handled in intermediate layers. - */ - struct vnode *vp = ap->a_vp; - int vnflags, flags = ap->a_flags; - - if (vp->v_vnlock == NULL) { - if ((flags & LK_TYPE_MASK) == LK_DRAIN) - return (0); - MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock), - M_VNODE, M_WAITOK); - lockinit(vp->v_vnlock, PVFS, "vnlock", 0, 0); - } - switch (flags & LK_TYPE_MASK) { - case LK_DRAIN: - vnflags = LK_DRAIN; - break; - case LK_EXCLUSIVE: -#ifdef DEBUG_VFS_LOCKS - /* - * Normally, we use shared locks here, but that confuses - * the locking assertions. - */ - vnflags = LK_EXCLUSIVE; - break; -#endif - case LK_SHARED: - vnflags = LK_SHARED; - break; - case LK_UPGRADE: - case LK_EXCLUPGRADE: - case LK_DOWNGRADE: - return (0); - case LK_RELEASE: - default: - panic("vop_sharedlock: bad operation %d", flags & LK_TYPE_MASK); - } - if (flags & LK_INTERLOCK) - vnflags |= LK_INTERLOCK; - return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p)); -} - -/* - * Stubs to use when there is no locking to be done on the underlying object. - * A minimal shared lock is necessary to ensure that the underlying object - * is not revoked while an operation is in progress. So, an active shared - * count is maintained in an auxillary vnode lock structure. - */ -int -vop_nolock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ -#ifdef notyet - /* - * This code cannot be used until all the non-locking filesystems - * (notably NFS) are converted to properly lock and release nodes. - * Also, certain vnode operations change the locking state within - * the operation (create, mknod, remove, link, rename, mkdir, rmdir, - * and symlink). Ideally these operations should not change the - * lock state, but should be changed to let the caller of the - * function unlock them. Otherwise all intermediate vnode layers - * (such as union, umapfs, etc) must catch these functions to do - * the necessary locking at their layer. Note that the inactive - * and lookup operations also change their lock state, but this - * cannot be avoided, so these two operations will always need - * to be handled in intermediate layers. - */ - struct vnode *vp = ap->a_vp; - int vnflags, flags = ap->a_flags; - - if (vp->v_vnlock == NULL) { - if ((flags & LK_TYPE_MASK) == LK_DRAIN) - return (0); - MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock), - M_VNODE, M_WAITOK); - lockinit(vp->v_vnlock, PVFS, "vnlock", 0, 0); - } - switch (flags & LK_TYPE_MASK) { - case LK_DRAIN: - vnflags = LK_DRAIN; - break; - case LK_EXCLUSIVE: - case LK_SHARED: - vnflags = LK_SHARED; - break; - case LK_UPGRADE: - case LK_EXCLUPGRADE: - case LK_DOWNGRADE: - return (0); - case LK_RELEASE: - default: - panic("vop_nolock: bad operation %d", flags & LK_TYPE_MASK); - } - if (flags & LK_INTERLOCK) - vnflags |= LK_INTERLOCK; - return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p)); -#else /* for now */ - /* - * Since we are not using the lock manager, we must clear - * the interlock here. - */ - if (ap->a_flags & LK_INTERLOCK) { - simple_unlock(&ap->a_vp->v_interlock); - } - return (0); -#endif -} - -/* - * Do the inverse of vop_nolock, handling the interlock in a compatible way. - */ -int -vop_nounlock(ap) - struct vop_unlock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - if (vp->v_vnlock == NULL) { - if (ap->a_flags & LK_INTERLOCK) - simple_unlock(&ap->a_vp->v_interlock); - return (0); - } - return (lockmgr(vp->v_vnlock, LK_RELEASE | ap->a_flags, - &ap->a_vp->v_interlock, ap->a_p)); -} - -/* - * Return whether or not the node is in use. - */ -int -vop_noislocked(ap) - struct vop_islocked_args /* { - struct vnode *a_vp; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - if (vp->v_vnlock == NULL) - return (0); - return (lockstatus(vp->v_vnlock)); -} - /* #ifdef DIAGNOSTIC */ /* * Vnode reference, just increment the count @@ -1640,26 +1464,6 @@ loop: simple_unlock(&spechash_slock); return (count); } - -/* - * Return true for select/poll. - */ -int -vop_nopoll(ap) - struct vop_poll_args /* { - struct vnode *a_vp; - int a_events; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; -{ - - /* - * Just return what we were asked for. - */ - return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); -} - /* * Print out a description of a vnode. */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 03c64d259f45..ebc4dc3ecfa3 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.109 1997/10/11 18:31:26 phk Exp $ + * $Id: vfs_subr.c,v 1.110 1997/10/12 20:24:26 phk Exp $ */ /* @@ -867,182 +867,6 @@ vget(vp, flags, p) simple_unlock(&vp->v_interlock); return (0); } - -/* - * Stubs to use when there is no locking to be done on the underlying object. - * A minimal shared lock is necessary to ensure that the underlying object - * is not revoked while an operation is in progress. So, an active shared - * count is maintained in an auxillary vnode lock structure. - */ -int -vop_sharedlock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ - /* - * This code cannot be used until all the non-locking filesystems - * (notably NFS) are converted to properly lock and release nodes. - * Also, certain vnode operations change the locking state within - * the operation (create, mknod, remove, link, rename, mkdir, rmdir, - * and symlink). Ideally these operations should not change the - * lock state, but should be changed to let the caller of the - * function unlock them. Otherwise all intermediate vnode layers - * (such as union, umapfs, etc) must catch these functions to do - * the necessary locking at their layer. Note that the inactive - * and lookup operations also change their lock state, but this - * cannot be avoided, so these two operations will always need - * to be handled in intermediate layers. - */ - struct vnode *vp = ap->a_vp; - int vnflags, flags = ap->a_flags; - - if (vp->v_vnlock == NULL) { - if ((flags & LK_TYPE_MASK) == LK_DRAIN) - return (0); - MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock), - M_VNODE, M_WAITOK); - lockinit(vp->v_vnlock, PVFS, "vnlock", 0, 0); - } - switch (flags & LK_TYPE_MASK) { - case LK_DRAIN: - vnflags = LK_DRAIN; - break; - case LK_EXCLUSIVE: -#ifdef DEBUG_VFS_LOCKS - /* - * Normally, we use shared locks here, but that confuses - * the locking assertions. - */ - vnflags = LK_EXCLUSIVE; - break; -#endif - case LK_SHARED: - vnflags = LK_SHARED; - break; - case LK_UPGRADE: - case LK_EXCLUPGRADE: - case LK_DOWNGRADE: - return (0); - case LK_RELEASE: - default: - panic("vop_sharedlock: bad operation %d", flags & LK_TYPE_MASK); - } - if (flags & LK_INTERLOCK) - vnflags |= LK_INTERLOCK; - return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p)); -} - -/* - * Stubs to use when there is no locking to be done on the underlying object. - * A minimal shared lock is necessary to ensure that the underlying object - * is not revoked while an operation is in progress. So, an active shared - * count is maintained in an auxillary vnode lock structure. - */ -int -vop_nolock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ -#ifdef notyet - /* - * This code cannot be used until all the non-locking filesystems - * (notably NFS) are converted to properly lock and release nodes. - * Also, certain vnode operations change the locking state within - * the operation (create, mknod, remove, link, rename, mkdir, rmdir, - * and symlink). Ideally these operations should not change the - * lock state, but should be changed to let the caller of the - * function unlock them. Otherwise all intermediate vnode layers - * (such as union, umapfs, etc) must catch these functions to do - * the necessary locking at their layer. Note that the inactive - * and lookup operations also change their lock state, but this - * cannot be avoided, so these two operations will always need - * to be handled in intermediate layers. - */ - struct vnode *vp = ap->a_vp; - int vnflags, flags = ap->a_flags; - - if (vp->v_vnlock == NULL) { - if ((flags & LK_TYPE_MASK) == LK_DRAIN) - return (0); - MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock), - M_VNODE, M_WAITOK); - lockinit(vp->v_vnlock, PVFS, "vnlock", 0, 0); - } - switch (flags & LK_TYPE_MASK) { - case LK_DRAIN: - vnflags = LK_DRAIN; - break; - case LK_EXCLUSIVE: - case LK_SHARED: - vnflags = LK_SHARED; - break; - case LK_UPGRADE: - case LK_EXCLUPGRADE: - case LK_DOWNGRADE: - return (0); - case LK_RELEASE: - default: - panic("vop_nolock: bad operation %d", flags & LK_TYPE_MASK); - } - if (flags & LK_INTERLOCK) - vnflags |= LK_INTERLOCK; - return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p)); -#else /* for now */ - /* - * Since we are not using the lock manager, we must clear - * the interlock here. - */ - if (ap->a_flags & LK_INTERLOCK) { - simple_unlock(&ap->a_vp->v_interlock); - } - return (0); -#endif -} - -/* - * Do the inverse of vop_nolock, handling the interlock in a compatible way. - */ -int -vop_nounlock(ap) - struct vop_unlock_args /* { - struct vnode *a_vp; - int a_flags; - struct proc *a_p; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - if (vp->v_vnlock == NULL) { - if (ap->a_flags & LK_INTERLOCK) - simple_unlock(&ap->a_vp->v_interlock); - return (0); - } - return (lockmgr(vp->v_vnlock, LK_RELEASE | ap->a_flags, - &ap->a_vp->v_interlock, ap->a_p)); -} - -/* - * Return whether or not the node is in use. - */ -int -vop_noislocked(ap) - struct vop_islocked_args /* { - struct vnode *a_vp; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - if (vp->v_vnlock == NULL) - return (0); - return (lockstatus(vp->v_vnlock)); -} - /* #ifdef DIAGNOSTIC */ /* * Vnode reference, just increment the count @@ -1640,26 +1464,6 @@ loop: simple_unlock(&spechash_slock); return (count); } - -/* - * Return true for select/poll. - */ -int -vop_nopoll(ap) - struct vop_poll_args /* { - struct vnode *a_vp; - int a_events; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; -{ - - /* - * Just return what we were asked for. - */ - return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); -} - /* * Print out a description of a vnode. */ diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index c4bc9dc51ae2..6888f35d6aa9 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)dead_vnops.c 8.1 (Berkeley) 6/10/93 - * $Id: dead_vnops.c,v 1.19 1997/10/16 20:32:24 phk Exp $ + * $Id: dead_vnops.c,v 1.20 1997/10/16 21:59:55 phk Exp $ */ #include @@ -45,7 +45,6 @@ static int chkvnlock __P((struct vnode *)); * Prototypes for dead operations on vnodes. */ static int dead_badop __P((void)); -static int dead_ebadf __P((void)); static int dead_lookup __P((struct vop_lookup_args *)); static int dead_open __P((struct vop_open_args *)); static int dead_read __P((struct vop_read_args *)); @@ -57,13 +56,13 @@ static int dead_print __P((struct vop_print_args *)); vop_t **dead_vnodeop_p; static struct vnodeopv_entry_desc dead_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) dead_ebadf }, - { &vop_advlock_desc, (vop_t *) dead_ebadf }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_ebadf }, + { &vop_advlock_desc, (vop_t *) vop_ebadf }, { &vop_bmap_desc, (vop_t *) dead_bmap }, { &vop_create_desc, (vop_t *) dead_badop }, - { &vop_getattr_desc, (vop_t *) dead_ebadf }, - { &vop_inactive_desc, (vop_t *) nullop }, + { &vop_getattr_desc, (vop_t *) vop_ebadf }, + { &vop_inactive_desc, (vop_t *) vop_null }, { &vop_ioctl_desc, (vop_t *) dead_ioctl }, { &vop_link_desc, (vop_t *) dead_badop }, { &vop_lock_desc, (vop_t *) dead_lock }, @@ -72,16 +71,16 @@ static struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_mknod_desc, (vop_t *) dead_badop }, { &vop_mmap_desc, (vop_t *) dead_badop }, { &vop_open_desc, (vop_t *) dead_open }, - { &vop_pathconf_desc, (vop_t *) dead_ebadf }, /* per pathconf(2) */ + { &vop_pathconf_desc, (vop_t *) vop_ebadf }, /* per pathconf(2) */ { &vop_print_desc, (vop_t *) dead_print }, { &vop_read_desc, (vop_t *) dead_read }, - { &vop_readdir_desc, (vop_t *) dead_ebadf }, - { &vop_readlink_desc, (vop_t *) dead_ebadf }, - { &vop_reclaim_desc, (vop_t *) nullop }, + { &vop_readdir_desc, (vop_t *) vop_ebadf }, + { &vop_readlink_desc, (vop_t *) vop_ebadf }, + { &vop_reclaim_desc, (vop_t *) vop_null }, { &vop_remove_desc, (vop_t *) dead_badop }, { &vop_rename_desc, (vop_t *) dead_badop }, { &vop_rmdir_desc, (vop_t *) dead_badop }, - { &vop_setattr_desc, (vop_t *) dead_ebadf }, + { &vop_setattr_desc, (vop_t *) vop_ebadf }, { &vop_symlink_desc, (vop_t *) dead_badop }, { &vop_write_desc, (vop_t *) dead_write }, { NULL, NULL } @@ -260,16 +259,6 @@ dead_print(ap) return (0); } -/* - * Empty vnode failed operation - */ -static int -dead_ebadf() -{ - - return (EBADF); -} - /* * Empty vnode bad operation */ diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index 8717a4e7b933..7b5fefca80b5 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -1,7 +1,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.45 1997/10/16 20:32:24 phk Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.46 1997/10/16 21:59:59 phk Exp $ * * symlinks can wait 'til later. */ @@ -1522,7 +1522,7 @@ devfs_dropvnode(dn_p dnp) vop_t **devfs_vnodeop_p; static struct vnodeopv_entry_desc devfs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) devfs_access }, { &vop_bmap_desc, (vop_t *) devfs_badop }, { &vop_getattr_desc, (vop_t *) devfs_getattr }, diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index 8650eb650bcd..d92d429e00ad 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.30 1997/10/16 20:32:25 phk Exp $ + * $Id: fdesc_vnops.c,v 1.31 1997/10/16 22:00:05 phk Exp $ */ /* @@ -856,8 +856,8 @@ fdesc_badop() } static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) nullop }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_null }, { &vop_bmap_desc, (vop_t *) fdesc_badop }, { &vop_getattr_desc, (vop_t *) fdesc_getattr }, { &vop_inactive_desc, (vop_t *) fdesc_inactive }, diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 20fb82869e29..9074a1f8d4d2 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 - * $Id: fifo_vnops.c,v 1.33 1997/10/16 20:32:26 phk Exp $ + * $Id: fifo_vnops.c,v 1.34 1997/10/16 22:00:12 phk Exp $ */ #include @@ -60,7 +60,6 @@ struct fifoinfo { long fi_writers; }; -static int fifo_ebadf __P((void)); static int fifo_badop __P((void)); static int fifo_print __P((struct vop_print_args *)); static int fifo_lookup __P((struct vop_lookup_args *)); @@ -77,17 +76,17 @@ static int fifo_advlock __P((struct vop_advlock_args *)); vop_t **fifo_vnodeop_p; static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) fifo_badop }, - { &vop_access_desc, (vop_t *) fifo_ebadf }, + { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) fifo_advlock }, { &vop_bmap_desc, (vop_t *) fifo_bmap }, { &vop_close_desc, (vop_t *) fifo_close }, { &vop_create_desc, (vop_t *) fifo_badop }, - { &vop_getattr_desc, (vop_t *) fifo_ebadf }, + { &vop_getattr_desc, (vop_t *) vop_ebadf }, { &vop_inactive_desc, (vop_t *) fifo_inactive }, { &vop_ioctl_desc, (vop_t *) fifo_ioctl }, - { &vop_lease_desc, (vop_t *) nullop }, + { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) fifo_badop }, { &vop_lookup_desc, (vop_t *) fifo_lookup }, { &vop_mkdir_desc, (vop_t *) fifo_badop }, @@ -100,11 +99,11 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_readdir_desc, (vop_t *) fifo_badop }, { &vop_readlink_desc, (vop_t *) fifo_badop }, { &vop_reallocblks_desc, (vop_t *) fifo_badop }, - { &vop_reclaim_desc, (vop_t *) nullop }, + { &vop_reclaim_desc, (vop_t *) vop_null }, { &vop_remove_desc, (vop_t *) fifo_badop }, { &vop_rename_desc, (vop_t *) fifo_badop }, { &vop_rmdir_desc, (vop_t *) fifo_badop }, - { &vop_setattr_desc, (vop_t *) fifo_ebadf }, + { &vop_setattr_desc, (vop_t *) vop_ebadf }, { &vop_symlink_desc, (vop_t *) fifo_badop }, { &vop_write_desc, (vop_t *) fifo_write }, { NULL, NULL } @@ -484,16 +483,6 @@ fifo_print(ap) return (0); } -/* - * Fifo failed operation - */ -static int -fifo_ebadf() -{ - - return (EBADF); -} - /* * Fifo advisory byte-level locks. */ diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 5ccaab6f2ed6..e7ffd4b780cf 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95 - * $Id: kernfs_vnops.c,v 1.25 1997/10/16 20:32:27 phk Exp $ + * $Id: kernfs_vnops.c,v 1.26 1997/10/16 22:00:19 phk Exp $ */ /* @@ -649,7 +649,7 @@ kernfs_badop() vop_t **kernfs_vnodeop_p; static struct vnodeopv_entry_desc kernfs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) kernfs_access }, { &vop_bmap_desc, (vop_t *) kernfs_badop }, { &vop_getattr_desc, (vop_t *) kernfs_getattr }, diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c index 6e3745c17ee3..bcd24a8648a2 100644 --- a/sys/miscfs/portal/portal_vnops.c +++ b/sys/miscfs/portal/portal_vnops.c @@ -35,7 +35,7 @@ * * @(#)portal_vnops.c 8.14 (Berkeley) 5/21/95 * - * $Id: portal_vnops.c,v 1.25 1997/10/16 20:32:27 phk Exp $ + * $Id: portal_vnops.c,v 1.26 1997/10/16 22:00:27 phk Exp $ */ /* @@ -598,8 +598,8 @@ portal_badop() vop_t **portal_vnodeop_p; static struct vnodeopv_entry_desc portal_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) nullop }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_null }, { &vop_bmap_desc, (vop_t *) portal_badop }, { &vop_getattr_desc, (vop_t *) portal_getattr }, { &vop_inactive_desc, (vop_t *) portal_inactive }, diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index e439b13a0dce..ff8f90cd2d72 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.37 1997/10/16 20:32:28 phk Exp $ + * $Id: procfs_vnops.c,v 1.38 1997/10/16 22:00:36 phk Exp $ */ /* @@ -884,7 +884,7 @@ atopid(b, len) */ vop_t **procfs_vnodeop_p; static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) procfs_abortop }, { &vop_access_desc, (vop_t *) procfs_access }, { &vop_advlock_desc, (vop_t *) procfs_badop }, diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index bf9a24442d34..e01196f546d7 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.48 1997/10/16 20:32:29 phk Exp $ + * $Id: spec_vnops.c,v 1.49 1997/10/16 22:00:42 phk Exp $ */ #include @@ -58,7 +58,6 @@ #include -static int spec_ebadf __P((void)); static int spec_getattr __P((struct vop_getattr_args *)); static int spec_badop __P((void)); static int spec_strategy __P((struct vop_strategy_args *)); @@ -79,8 +78,8 @@ static int spec_getpages __P((struct vop_getpages_args *)); struct vnode *speclisth[SPECHSZ]; vop_t **spec_vnodeop_p; static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, - { &vop_access_desc, (vop_t *) spec_ebadf }, + { &vop_default_desc, (vop_t *) vop_defaultop }, + { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) spec_advlock }, { &vop_bmap_desc, (vop_t *) spec_bmap }, { &vop_close_desc, (vop_t *) spec_close }, @@ -90,7 +89,7 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_getpages_desc, (vop_t *) spec_getpages }, { &vop_inactive_desc, (vop_t *) spec_inactive }, { &vop_ioctl_desc, (vop_t *) spec_ioctl }, - { &vop_lease_desc, (vop_t *) nullop }, + { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) spec_badop }, { &vop_lookup_desc, (vop_t *) spec_lookup }, { &vop_mkdir_desc, (vop_t *) spec_badop }, @@ -103,11 +102,11 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_readdir_desc, (vop_t *) spec_badop }, { &vop_readlink_desc, (vop_t *) spec_badop }, { &vop_reallocblks_desc, (vop_t *) spec_badop }, - { &vop_reclaim_desc, (vop_t *) nullop }, + { &vop_reclaim_desc, (vop_t *) vop_null }, { &vop_remove_desc, (vop_t *) spec_badop }, { &vop_rename_desc, (vop_t *) spec_badop }, { &vop_rmdir_desc, (vop_t *) spec_badop }, - { &vop_setattr_desc, (vop_t *) spec_ebadf }, + { &vop_setattr_desc, (vop_t *) vop_ebadf }, { &vop_strategy_desc, (vop_t *) spec_strategy }, { &vop_symlink_desc, (vop_t *) spec_badop }, { &vop_write_desc, (vop_t *) spec_write }, @@ -696,16 +695,6 @@ spec_advlock(ap) return (ap->a_flags & F_FLOCK ? EOPNOTSUPP : EINVAL); } -/* - * Special device failed operation - */ -static int -spec_ebadf() -{ - - return (EBADF); -} - /* * Special device bad operation */ diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index e1c9a878a0cc..83dcb3ee6514 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.44 1997/10/15 10:04:54 phk Exp $ + * $Id: union_vnops.c,v 1.45 1997/10/16 20:32:30 phk Exp $ */ #include @@ -1739,7 +1739,7 @@ union_strategy(ap) */ vop_t **union_vnodeop_p; static struct vnodeopv_entry_desc union_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) union_abortop }, { &vop_access_desc, (vop_t *) union_access }, { &vop_advlock_desc, (vop_t *) union_advlock }, diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index d228f4951e4b..1b9cc4ea3d36 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.49 1997/10/16 20:32:31 phk Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.50 1997/10/17 12:36:17 phk Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -1833,7 +1833,7 @@ msdosfs_pathconf(ap) /* Global vfs data structures for msdosfs */ vop_t **msdosfs_vnodeop_p; static struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) msdosfs_abortop }, { &vop_access_desc, (vop_t *) msdosfs_access }, { &vop_bmap_desc, (vop_t *) msdosfs_bmap }, diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 132e3a59d913..840a6c5e5eb7 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.68 1997/10/16 20:32:32 phk Exp $ + * $Id: nfs_vnops.c,v 1.69 1997/10/16 22:00:51 phk Exp $ */ @@ -133,7 +133,7 @@ static int nfs_bwrite __P((struct vop_bwrite_args *)); */ vop_t **nfsv2_vnodeop_p; static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) nfs_abortop }, { &vop_access_desc, (vop_t *) nfs_access }, { &vop_advlock_desc, (vop_t *) nfs_advlock }, @@ -145,7 +145,7 @@ static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_getattr_desc, (vop_t *) nfs_getattr }, { &vop_getpages_desc, (vop_t *) nfs_getpages }, { &vop_inactive_desc, (vop_t *) nfs_inactive }, - { &vop_lease_desc, (vop_t *) nullop }, + { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) nfs_link }, { &vop_lock_desc, (vop_t *) vop_sharedlock }, { &vop_lookup_desc, (vop_t *) nfs_lookup }, diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 132e3a59d913..840a6c5e5eb7 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.68 1997/10/16 20:32:32 phk Exp $ + * $Id: nfs_vnops.c,v 1.69 1997/10/16 22:00:51 phk Exp $ */ @@ -133,7 +133,7 @@ static int nfs_bwrite __P((struct vop_bwrite_args *)); */ vop_t **nfsv2_vnodeop_p; static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_abortop_desc, (vop_t *) nfs_abortop }, { &vop_access_desc, (vop_t *) nfs_access }, { &vop_advlock_desc, (vop_t *) nfs_advlock }, @@ -145,7 +145,7 @@ static struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = { { &vop_getattr_desc, (vop_t *) nfs_getattr }, { &vop_getpages_desc, (vop_t *) nfs_getpages }, { &vop_inactive_desc, (vop_t *) nfs_inactive }, - { &vop_lease_desc, (vop_t *) nullop }, + { &vop_lease_desc, (vop_t *) vop_null }, { &vop_link_desc, (vop_t *) nfs_link }, { &vop_lock_desc, (vop_t *) vop_sharedlock }, { &vop_lookup_desc, (vop_t *) nfs_lookup }, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 7685fe547d8c..a1abbc7cb6d7 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 - * $Id: vnode.h,v 1.53 1997/10/17 12:36:18 phk Exp $ + * $Id: vnode.h,v 1.54 1997/10/26 20:26:14 phk Exp $ */ #ifndef _SYS_VNODE_H_ @@ -478,7 +478,6 @@ int vinvalbuf __P((struct vnode *vp, int save, struct ucred *cred, void vprint __P((char *label, struct vnode *vp)); int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp, struct proc *p)); -int vn_bwrite __P((struct vop_bwrite_args *ap)); int vn_close __P((struct vnode *vp, int flags, struct ucred *cred, struct proc *p)); int vn_lock __P((struct vnode *vp, int flags, struct proc *p)); @@ -491,6 +490,7 @@ int vfs_cache_lookup __P((struct vop_lookup_args *ap)); int vfs_object_create __P((struct vnode *vp, struct proc *p, struct ucred *cred, int waslocked)); int vn_writechk __P((struct vnode *vp)); +int vop_stdbwrite __P((struct vop_bwrite_args *ap)); int vop_stdislocked __P((struct vop_islocked_args *)); int vop_stdlock __P((struct vop_lock_args *)); int vop_stdunlock __P((struct vop_unlock_args *)); @@ -508,14 +508,13 @@ int vop_enotty __P((struct vop_generic_args *ap)); int vop_defaultop __P((struct vop_generic_args *ap)); int vop_null __P((struct vop_generic_args *ap)); -/* XXX: compat until fixed all places*/ -#define vn_default_error vop_defaultop - struct vnode * checkalias __P((struct vnode *vp, dev_t nvp_rdev, struct mount *mp)); void vput __P((struct vnode *vp)); void vref __P((struct vnode *vp)); void vrele __P((struct vnode *vp)); + +extern vop_t **default_vnodeop_p; #endif /* KERNEL */ #endif /* !_SYS_VNODE_H_ */ diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index 674267003d67..feaaeec56b7b 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mfs_vnops.c 8.11 (Berkeley) 5/22/95 - * $Id: mfs_vnops.c,v 1.28 1997/10/19 01:36:49 dyson Exp $ + * $Id: mfs_vnops.c,v 1.29 1997/10/20 19:53:26 phk Exp $ */ #include @@ -70,6 +70,7 @@ static struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { { &vop_bwrite_desc, (vop_t *) vop_defaultop }, { &vop_close_desc, (vop_t *) mfs_close }, { &vop_fsync_desc, (vop_t *) mfs_fsync }, + { &vop_getpages_desc, (vop_t *) vop_defaultop }, { &vop_inactive_desc, (vop_t *) mfs_inactive }, { &vop_ioctl_desc, (vop_t *) vop_enotty }, { &vop_islocked_desc, (vop_t *) vop_defaultop }, diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index ce7ca2d2ad45..e3f6f426956a 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 - * $Id: ufs_vnops.c,v 1.62 1997/10/16 20:32:39 phk Exp $ + * $Id: ufs_vnops.c,v 1.63 1997/10/17 12:36:19 phk Exp $ */ #include "opt_quota.h" @@ -2081,7 +2081,7 @@ ufs_missingop(ap) /* Global vfs data structures for ufs. */ vop_t **ufs_vnodeop_p; static struct vnodeopv_entry_desc ufs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vn_default_error }, + { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_fsync_desc, (vop_t *) ufs_missingop }, { &vop_getpages_desc, (vop_t *) ufs_missingop }, { &vop_read_desc, (vop_t *) ufs_missingop },