summaryrefslogtreecommitdiff
path: root/sys/miscfs/fifofs
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2010-09-06 23:44:12 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2010-09-06 23:44:12 +0000
commit87f3d58d3064a78c9b29faa668f1d98225f01e71 (patch)
treebbc6c4fb3c1748ac72b8b1b8bab76b4e91896fd0 /sys/miscfs/fifofs
parenta41bd31e53cce764c5bc6861ce6be4074cc59551 (diff)
End the VOP experiment. Instead of the ridicolusly complicated operation
vector setup that has questionable features (that have, as far as I can tell never been used in practice, atleast not in OpenBSD), remove all the gunk and favor a simple struct full of function pointers that get set directly by each of the filesystems. Removes gobs of ugly code and makes things simpler by a magnitude. The only downside of this is that we loose the vnoperate feature so the spec/fifo operations of the filesystems need to be kept in sync with specfs and fifofs, this is no big deal as the API it self is pretty static. Many thanks to armani@ who pulled an earlier version of this diff to current after c2k10 and Gabriel Kihlman on tech@ for testing. Liked by many. "come on, find your balls" deraadt@.
Diffstat (limited to 'sys/miscfs/fifofs')
-rw-r--r--sys/miscfs/fifofs/fifo.h6
-rw-r--r--sys/miscfs/fifofs/fifo_vnops.c89
2 files changed, 39 insertions, 56 deletions
diff --git a/sys/miscfs/fifofs/fifo.h b/sys/miscfs/fifofs/fifo.h
index 77a8a4c52c9..e0172ce1dfe 100644
--- a/sys/miscfs/fifofs/fifo.h
+++ b/sys/miscfs/fifofs/fifo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fifo.h,v 1.19 2008/05/03 14:41:29 thib Exp $ */
+/* $OpenBSD: fifo.h,v 1.20 2010/09/06 23:44:10 thib Exp $ */
/* $NetBSD: fifo.h,v 1.10 1996/02/09 22:40:15 christos Exp $ */
/*
@@ -53,8 +53,4 @@ 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 d5884f20bef..6a8c984fa8d 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.31 2009/08/13 15:00:14 jasper Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.32 2010/09/06 23:44:10 thib Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
@@ -61,58 +61,45 @@ struct fifoinfo {
long fi_writers;
};
-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 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
};
-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);