From 924988b6ec2a9e6a026b5489028ad504451931ac Mon Sep 17 00:00:00 2001 From: "Thordur I. Bjornsson" Date: Fri, 10 Sep 2010 16:34:10 +0000 Subject: Backout the VOP diff until the issues naddy was seeing on alpha (gcc3) have been resolved. --- sys/miscfs/deadfs/dead_vnops.c | 81 +++++++++++++++++++----------------- sys/miscfs/fifofs/fifo.h | 6 ++- sys/miscfs/fifofs/fifo_vnops.c | 89 +++++++++++++++++++++++----------------- sys/miscfs/procfs/procfs.h | 4 +- sys/miscfs/procfs/procfs_subr.c | 4 +- sys/miscfs/procfs/procfs_vnops.c | 74 +++++++++++++++++---------------- sys/miscfs/specfs/spec_vnops.c | 88 ++++++++++++++++++++++----------------- sys/miscfs/specfs/specdev.h | 6 ++- 8 files changed, 196 insertions(+), 156 deletions(-) (limited to 'sys/miscfs') diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index 141f9385f51..d2d5d6c216b 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dead_vnops.c,v 1.23 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: dead_vnops.c,v 1.24 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */ /* @@ -60,42 +60,47 @@ int dead_print(void *); int chkvnlock(struct vnode *); -struct vops dead_vops = { - .vop_default = eopnotsupp, - .vop_lookup = vop_generic_lookup, - .vop_create = dead_badop, - .vop_mknod = dead_badop, - .vop_open = dead_open, - .vop_close = nullop, - .vop_access = dead_ebadf, - .vop_getattr = dead_ebadf, - .vop_setattr = dead_ebadf, - .vop_read = dead_read, - .vop_write = dead_write, - .vop_ioctl = dead_ioctl, - .vop_poll = dead_poll, - .vop_fsync = nullop, - .vop_remove = dead_badop, - .vop_link = dead_badop, - .vop_rename = dead_badop, - .vop_mkdir = dead_badop, - .vop_rmdir = dead_badop, - .vop_symlink = dead_badop, - .vop_readdir = dead_ebadf, - .vop_readlink = dead_ebadf, - .vop_abortop = dead_badop, - .vop_inactive = nullop, - .vop_reclaim = nullop, - .vop_lock = dead_lock, - .vop_unlock = vop_generic_unlock, - .vop_bmap = dead_bmap, - .vop_strategy = dead_strategy, - .vop_print = dead_print, - .vop_islocked = vop_generic_islocked, - .vop_pathconf = dead_ebadf, - .vop_advlock = dead_ebadf, - .vop_bwrite = nullop, +int (**dead_vnodeop_p)(void *); + +struct vnodeopv_entry_desc dead_vnodeop_entries[] = { + { &vop_default_desc, eopnotsupp }, + { &vop_lookup_desc, vop_generic_lookup }, + { &vop_create_desc, dead_badop }, + { &vop_mknod_desc, dead_badop }, + { &vop_open_desc, dead_open }, + { &vop_close_desc, nullop }, + { &vop_access_desc, dead_ebadf }, + { &vop_getattr_desc, dead_ebadf }, + { &vop_setattr_desc, dead_ebadf }, + { &vop_read_desc, dead_read }, + { &vop_write_desc, dead_write }, + { &vop_ioctl_desc, dead_ioctl }, + { &vop_poll_desc, dead_poll }, + { &vop_fsync_desc, nullop }, + { &vop_remove_desc, dead_badop }, + { &vop_link_desc, dead_badop }, + { &vop_rename_desc, dead_badop }, + { &vop_mkdir_desc, dead_badop }, + { &vop_rmdir_desc, dead_badop }, + { &vop_symlink_desc, dead_badop }, + { &vop_readdir_desc, dead_ebadf }, + { &vop_readlink_desc, dead_ebadf }, + { &vop_abortop_desc, dead_badop }, + { &vop_inactive_desc, nullop }, + { &vop_reclaim_desc, nullop }, + { &vop_lock_desc, dead_lock }, + { &vop_unlock_desc, vop_generic_unlock }, + { &vop_bmap_desc, dead_bmap }, + { &vop_strategy_desc, dead_strategy }, + { &vop_print_desc, dead_print }, + { &vop_islocked_desc, vop_generic_islocked }, + { &vop_pathconf_desc, dead_ebadf }, + { &vop_advlock_desc, dead_ebadf }, + { &vop_bwrite_desc, nullop }, + { (struct vnodeop_desc*)NULL, (int(*)(void *))NULL } }; +struct vnodeopv_desc dead_vnodeop_opv_desc = + { &dead_vnodeop_p, dead_vnodeop_entries }; /* * Open always fails as if device did not exist. @@ -151,7 +156,7 @@ dead_ioctl(void *v) if (!chkvnlock(ap->a_vp)) return (EBADF); - return ((ap->a_vp->v_op->vop_ioctl)(ap)); + return (VCALL(ap->a_vp, VOFFSET(vop_ioctl), ap)); } /* ARGSUSED */ @@ -199,7 +204,7 @@ dead_lock(void *v) if (ap->a_flags & LK_DRAIN || !chkvnlock(vp)) return (0); - return ((vp->v_op->vop_lock)(ap)); + return (VCALL(vp, VOFFSET(vop_lock), ap)); } /* diff --git a/sys/miscfs/fifofs/fifo.h b/sys/miscfs/fifofs/fifo.h index e0172ce1dfe..624ecbaadef 100644 --- a/sys/miscfs/fifofs/fifo.h +++ b/sys/miscfs/fifofs/fifo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo.h,v 1.20 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: fifo.h,v 1.21 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: fifo.h,v 1.10 1996/02/09 22:40:15 christos Exp $ */ /* @@ -53,4 +53,8 @@ int fifo_pathconf(void *); int fifo_advlock(void *); void fifo_printinfo(struct vnode *); +int fifo_vnoperate(void *); + +extern int (**fifo_vnodeop_p)(void *); + #endif /* FIFO */ diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 6a8c984fa8d..fd24c082f4a 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.32 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.33 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -61,45 +61,58 @@ struct fifoinfo { long fi_writers; }; -struct vops fifo_vops = { - .vop_default = eopnotsupp, - .vop_lookup = vop_generic_lookup, - .vop_create = fifo_badop, - .vop_mknod = fifo_badop, - .vop_open = fifo_open, - .vop_close = fifo_close, - .vop_access = fifo_ebadf, - .vop_getattr = fifo_ebadf, - .vop_setattr = fifo_ebadf, - .vop_read = fifo_read, - .vop_write = fifo_write, - .vop_ioctl = fifo_ioctl, - .vop_poll = fifo_poll, - .vop_kqfilter = fifo_kqfilter, - .vop_revoke = vop_generic_revoke, - .vop_fsync = nullop, - .vop_remove = fifo_badop, - .vop_link = fifo_badop, - .vop_rename = fifo_badop, - .vop_mkdir = fifo_badop, - .vop_rmdir = fifo_badop, - .vop_symlink = fifo_badop, - .vop_readdir = fifo_badop, - .vop_readlink = fifo_badop, - .vop_abortop = fifo_badop, - .vop_inactive = fifo_inactive, - .vop_reclaim = fifo_reclaim, - .vop_lock = vop_generic_lock, - .vop_unlock = vop_generic_unlock, - .vop_bmap = vop_generic_bmap, - .vop_strategy = fifo_badop, - .vop_print = fifo_print, - .vop_islocked = vop_generic_islocked, - .vop_pathconf = fifo_pathconf, - .vop_advlock = fifo_advlock, - .vop_bwrite = nullop +int (**fifo_vnodeop_p)(void *); +struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { + { &vop_default_desc, eopnotsupp }, + { &vop_lookup_desc, vop_generic_lookup }, + { &vop_create_desc, fifo_badop }, + { &vop_mknod_desc, fifo_badop }, + { &vop_open_desc, fifo_open }, + { &vop_close_desc, fifo_close }, + { &vop_access_desc, fifo_ebadf }, + { &vop_getattr_desc, fifo_ebadf }, + { &vop_setattr_desc, fifo_ebadf }, + { &vop_read_desc, fifo_read }, + { &vop_write_desc, fifo_write }, + { &vop_ioctl_desc, fifo_ioctl }, + { &vop_poll_desc, fifo_poll }, + { &vop_kqfilter_desc, fifo_kqfilter }, + { &vop_revoke_desc, vop_generic_revoke }, + { &vop_fsync_desc, nullop }, + { &vop_remove_desc, fifo_badop }, + { &vop_link_desc, fifo_badop }, + { &vop_rename_desc, fifo_badop }, + { &vop_mkdir_desc, fifo_badop }, + { &vop_rmdir_desc, fifo_badop }, + { &vop_symlink_desc, fifo_badop }, + { &vop_readdir_desc, fifo_badop }, + { &vop_readlink_desc, fifo_badop }, + { &vop_abortop_desc, fifo_badop }, + { &vop_inactive_desc, fifo_inactive }, + { &vop_reclaim_desc, fifo_reclaim }, + { &vop_lock_desc, vop_generic_lock }, + { &vop_unlock_desc, vop_generic_unlock }, + { &vop_bmap_desc, vop_generic_bmap }, + { &vop_strategy_desc, fifo_badop }, + { &vop_print_desc, fifo_print }, + { &vop_islocked_desc, vop_generic_islocked }, + { &vop_pathconf_desc, fifo_pathconf }, + { &vop_advlock_desc, fifo_advlock }, + { &vop_bwrite_desc, nullop }, + { NULL, NULL } }; +struct vnodeopv_desc fifo_vnodeop_opv_desc = + { &fifo_vnodeop_p, fifo_vnodeop_entries }; + +int +fifo_vnoperate(void *v) +{ + struct vop_generic_args *ap = v; + + return (VOCALL(fifo_vnodeop_p, ap->a_desc->vdesc_offset, ap)); +} + void filt_fifordetach(struct knote *kn); int filt_fiforead(struct knote *kn, long hint); void filt_fifowdetach(struct knote *kn); diff --git a/sys/miscfs/procfs/procfs.h b/sys/miscfs/procfs/procfs.h index cfb4a18ecc0..4e858b65661 100644 --- a/sys/miscfs/procfs/procfs.h +++ b/sys/miscfs/procfs/procfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs.h,v 1.25 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: procfs.h,v 1.26 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: procfs.h,v 1.17 1996/02/12 15:01:41 christos Exp $ */ /* @@ -135,7 +135,7 @@ int procfs_rw(void *); #define PROCFS_LOCKED 0x01 #define PROCFS_WANT 0x02 -extern struct vops procfs_vops; +extern int (**procfs_vnodeop_p)(void *); extern const struct vfsops procfs_vfsops; struct vfsconf; diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index e57ed21d404..2b1985e098f 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_subr.c,v 1.32 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: procfs_subr.c,v 1.33 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */ /* @@ -111,7 +111,7 @@ loop: } } - if ((error = getnewvnode(VT_PROCFS, mp, &procfs_vops, vpp)) != 0) + if ((error = getnewvnode(VT_PROCFS, mp, procfs_vnodeop_p, vpp)) != 0) goto out; vp = *vpp; diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 848f0e85214..c8cfed6fde2 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vnops.c,v 1.48 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: procfs_vnops.c,v 1.49 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: procfs_vnops.c,v 1.40 1996/03/16 23:52:55 christos Exp $ */ /* @@ -138,41 +138,45 @@ static pid_t atopid(const char *, u_int); /* * procfs vnode operations. */ -struct vops procfs_vops = { - .vop_default = eopnotsupp, - .vop_lookup = procfs_lookup, - .vop_create = procfs_badop, - .vop_mknod = procfs_badop, - .vop_open = procfs_open, - .vop_close = procfs_close, - .vop_access = procfs_access, - .vop_getattr = procfs_getattr, - .vop_setattr = procfs_setattr, - .vop_read = procfs_rw, - .vop_write = procfs_rw, - .vop_ioctl = procfs_ioctl, - .vop_poll = procfs_poll, - .vop_fsync = procfs_badop, - .vop_remove = procfs_badop, - .vop_link = procfs_link, - .vop_rename = procfs_badop, - .vop_mkdir = procfs_badop, - .vop_rmdir = procfs_badop, - .vop_symlink = procfs_symlink, - .vop_readdir = procfs_readdir, - .vop_readlink = procfs_readlink, - .vop_abortop = vop_generic_abortop, - .vop_inactive = procfs_inactive, - .vop_reclaim = procfs_reclaim, - .vop_lock = nullop, - .vop_unlock = nullop, - .vop_bmap = vop_generic_bmap, - .vop_strategy = procfs_badop, - .vop_print = procfs_print, - .vop_islocked = nullop, - .vop_pathconf = procfs_pathconf, - .vop_advlock = procfs_badop, +int (**procfs_vnodeop_p)(void *); +struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { + { &vop_default_desc, eopnotsupp }, + { &vop_lookup_desc, procfs_lookup }, + { &vop_create_desc, procfs_badop }, + { &vop_mknod_desc, procfs_badop }, + { &vop_open_desc, procfs_open }, + { &vop_close_desc, procfs_close }, + { &vop_access_desc, procfs_access }, + { &vop_getattr_desc, procfs_getattr }, + { &vop_setattr_desc, procfs_setattr }, + { &vop_read_desc, procfs_rw }, + { &vop_write_desc, procfs_rw }, + { &vop_ioctl_desc, procfs_ioctl }, + { &vop_poll_desc, procfs_poll }, + { &vop_fsync_desc, procfs_badop}, + { &vop_remove_desc, procfs_badop }, + { &vop_link_desc, procfs_link }, + { &vop_rename_desc, procfs_badop }, + { &vop_mkdir_desc, procfs_badop }, + { &vop_rmdir_desc, procfs_badop }, + { &vop_symlink_desc, procfs_symlink }, + { &vop_readdir_desc, procfs_readdir }, + { &vop_readlink_desc, procfs_readlink }, + { &vop_abortop_desc, vop_generic_abortop }, + { &vop_inactive_desc, procfs_inactive }, + { &vop_reclaim_desc, procfs_reclaim }, + { &vop_lock_desc, nullop }, + { &vop_unlock_desc, nullop }, + { &vop_bmap_desc, vop_generic_bmap }, + { &vop_strategy_desc, procfs_badop }, + { &vop_print_desc, procfs_print }, + { &vop_islocked_desc, nullop }, + { &vop_pathconf_desc, procfs_pathconf }, + { &vop_advlock_desc, procfs_badop }, + { NULL, NULL } }; +struct vnodeopv_desc procfs_vnodeop_opv_desc = + { &procfs_vnodeop_p, procfs_vnodeop_entries }; /* * set things up for doing i/o on * the pfsnode (vp). (vp) is locked diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 2b613924840..c969db0348e 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.59 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.60 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -56,44 +56,56 @@ struct vnode *speclisth[SPECHSZ]; -struct vops spec_vops = { - .vop_default = eopnotsupp, - .vop_lookup = vop_generic_lookup, - .vop_create = spec_badop, - .vop_mknod = spec_badop, - .vop_open = spec_open, - .vop_close = spec_close, - .vop_access = spec_access, - .vop_getattr = spec_getattr, - .vop_setattr = spec_setattr, - .vop_read = spec_read, - .vop_write = spec_write, - .vop_ioctl = spec_ioctl, - .vop_poll = spec_poll, - .vop_kqfilter = spec_kqfilter, - .vop_revoke = vop_generic_revoke, - .vop_fsync = spec_fsync, - .vop_remove = spec_badop, - .vop_link = spec_badop, - .vop_rename = spec_badop, - .vop_mkdir = spec_badop, - .vop_rmdir = spec_badop, - .vop_symlink = spec_badop, - .vop_readdir = spec_badop, - .vop_readlink = spec_badop, - .vop_abortop = spec_badop, - .vop_inactive = spec_inactive, - .vop_reclaim = nullop, - .vop_lock = vop_generic_lock, - .vop_unlock = vop_generic_unlock, - .vop_islocked = vop_generic_islocked, - .vop_bmap = vop_generic_bmap, - .vop_strategy = spec_strategy, - .vop_print = spec_print, - .vop_pathconf = spec_pathconf, - .vop_advlock = spec_advlock, - .vop_bwrite = vop_generic_bwrite, +int (**spec_vnodeop_p)(void *); +struct vnodeopv_entry_desc spec_vnodeop_entries[] = { + { &vop_default_desc, eopnotsupp }, + { &vop_lookup_desc, vop_generic_lookup }, + { &vop_create_desc, spec_badop }, + { &vop_mknod_desc, spec_badop }, + { &vop_open_desc, spec_open }, + { &vop_close_desc, spec_close }, + { &vop_access_desc, spec_access }, + { &vop_getattr_desc, spec_getattr }, + { &vop_setattr_desc, spec_setattr }, + { &vop_read_desc, spec_read }, + { &vop_write_desc, spec_write }, + { &vop_ioctl_desc, spec_ioctl }, + { &vop_poll_desc, spec_poll }, + { &vop_kqfilter_desc, spec_kqfilter }, + { &vop_revoke_desc, vop_generic_revoke }, + { &vop_fsync_desc, spec_fsync }, + { &vop_remove_desc, spec_badop }, + { &vop_link_desc, spec_badop }, + { &vop_rename_desc, spec_badop }, + { &vop_mkdir_desc, spec_badop }, + { &vop_rmdir_desc, spec_badop }, + { &vop_symlink_desc, spec_badop }, + { &vop_readdir_desc, spec_badop }, + { &vop_readlink_desc, spec_badop }, + { &vop_abortop_desc, spec_badop }, + { &vop_inactive_desc, spec_inactive }, + { &vop_reclaim_desc, nullop }, + { &vop_lock_desc, vop_generic_lock }, + { &vop_unlock_desc, vop_generic_unlock }, + { &vop_bmap_desc, vop_generic_bmap }, + { &vop_strategy_desc, spec_strategy }, + { &vop_print_desc, spec_print }, + { &vop_islocked_desc, vop_generic_islocked }, + { &vop_pathconf_desc, spec_pathconf }, + { &vop_advlock_desc, spec_advlock }, + { &vop_bwrite_desc, vop_generic_bwrite }, + { NULL, NULL } }; +struct vnodeopv_desc spec_vnodeop_opv_desc = + { &spec_vnodeop_p, spec_vnodeop_entries }; + +int +spec_vnoperate(void *v) +{ + struct vop_generic_args *ap = v; + + return (VOCALL(spec_vnodeop_p, ap->a_desc->vdesc_offset, ap)); +} /* * Open a special file. diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index 98f917b6a09..daad3235132 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specdev.h,v 1.27 2010/09/06 23:44:10 thib Exp $ */ +/* $OpenBSD: specdev.h,v 1.28 2010/09/10 16:34:08 thib Exp $ */ /* $NetBSD: specdev.h,v 1.12 1996/02/13 13:13:01 mycroft Exp $ */ /* @@ -82,7 +82,7 @@ extern struct vnode *speclisth[SPECHSZ]; /* * Prototypes for special file operations on vnodes. */ -extern struct vops spec_vops; +extern int (**spec_vnodeop_p)(void *); struct nameidata; struct componentname; struct ucred; @@ -108,6 +108,8 @@ int spec_print(void *); int spec_pathconf(void *); int spec_advlock(void *); +int spec_vnoperate(void *); + /* spec_subr.c */ int spec_open_clone(struct vop_open_args *); int spec_close_clone(struct vop_close_args *); -- cgit v1.2.3