summaryrefslogtreecommitdiff
path: root/sys/isofs/cd9660/cd9660_vnops.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-11-08 04:34:19 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-11-08 04:34:19 +0000
commit19c98636e10b68ad30a4acbd83bce1df8b5597ce (patch)
tree6741880a682fa67ac6ba39ed1cc1a0e498f9d62f /sys/isofs/cd9660/cd9660_vnops.c
parent4fa084ae104c9bcb5a12e713575ec70f65739316 (diff)
Implement simple vnodeop inheritance for specfs and fifofs.
The inheritace is implemented by setting the default vnodeop to a bypass op that repeats the operation on the spec/fifo vnodeop vector. The overhead of one extra indirect function call is worth the cleanup and improved correctness. This actually solves a few bugs where some vnode ops were missing from some vectors (like kqfilter or revoke). (and even more on the ubc branch). Inspired by the same thing done in FreeBSD.
Diffstat (limited to 'sys/isofs/cd9660/cd9660_vnops.c')
-rw-r--r--sys/isofs/cd9660/cd9660_vnops.c63
1 files changed, 6 insertions, 57 deletions
diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c
index 20a4854af8f..4e96ba3dc18 100644
--- a/sys/isofs/cd9660/cd9660_vnops.c
+++ b/sys/isofs/cd9660/cd9660_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vnops.c,v 1.23 2002/05/24 13:41:27 art Exp $ */
+/* $OpenBSD: cd9660_vnops.c,v 1.24 2002/11/08 04:34:17 art Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
@@ -1061,7 +1061,7 @@ struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
{ &vop_pathconf_desc, cd9660_pathconf },/* pathconf */
{ &vop_advlock_desc, cd9660_advlock }, /* advlock */
{ &vop_bwrite_desc, vop_generic_bwrite },
- { (struct vnodeop_desc*)NULL, (int(*)(void *))NULL }
+ { NULL, NULL }
};
struct vnodeopv_desc cd9660_vnodeop_opv_desc =
{ &cd9660_vnodeop_p, cd9660_vnodeop_entries };
@@ -1071,43 +1071,17 @@ struct vnodeopv_desc cd9660_vnodeop_opv_desc =
*/
int (**cd9660_specop_p)(void *);
struct vnodeopv_entry_desc cd9660_specop_entries[] = {
- { &vop_default_desc, vn_default_error },
- { &vop_lookup_desc, spec_lookup }, /* lookup */
- { &vop_create_desc, spec_create }, /* create */
- { &vop_mknod_desc, spec_mknod }, /* mknod */
- { &vop_open_desc, spec_open }, /* open */
- { &vop_close_desc, spec_close }, /* close */
+ { &vop_default_desc, spec_vnoperate },
{ &vop_access_desc, cd9660_access }, /* access */
{ &vop_getattr_desc, cd9660_getattr }, /* getattr */
{ &vop_setattr_desc, cd9660_setattr }, /* setattr */
- { &vop_read_desc, spec_read }, /* read */
- { &vop_write_desc, spec_write }, /* write */
- { &vop_lease_desc, spec_lease_check }, /* lease */
- { &vop_ioctl_desc, spec_ioctl }, /* ioctl */
- { &vop_select_desc, spec_select }, /* select */
- { &vop_revoke_desc, spec_revoke }, /* revoke */
- { &vop_fsync_desc, spec_fsync }, /* fsync */
- { &vop_remove_desc, spec_remove }, /* remove */
- { &vop_link_desc, spec_link }, /* link */
- { &vop_rename_desc, spec_rename }, /* rename */
- { &vop_mkdir_desc, spec_mkdir }, /* mkdir */
- { &vop_rmdir_desc, spec_rmdir }, /* rmdir */
- { &vop_symlink_desc, spec_symlink }, /* symlink */
- { &vop_readdir_desc, spec_readdir }, /* readdir */
- { &vop_readlink_desc, spec_readlink }, /* readlink */
- { &vop_abortop_desc, spec_abortop }, /* abortop */
{ &vop_inactive_desc, cd9660_inactive },/* inactive */
{ &vop_reclaim_desc, cd9660_reclaim }, /* reclaim */
{ &vop_lock_desc, cd9660_lock }, /* lock */
{ &vop_unlock_desc, cd9660_unlock }, /* unlock */
- { &vop_bmap_desc, spec_bmap }, /* bmap */
- { &vop_strategy_desc, spec_strategy }, /* strategy */
{ &vop_print_desc, cd9660_print }, /* print */
{ &vop_islocked_desc, cd9660_islocked },/* islocked */
- { &vop_pathconf_desc, spec_pathconf }, /* pathconf */
- { &vop_advlock_desc, spec_advlock }, /* advlock */
- { &vop_bwrite_desc, vop_generic_bwrite },
- { (struct vnodeop_desc*)NULL, (int(*)(void *))NULL }
+ { NULL, NULL }
};
struct vnodeopv_desc cd9660_specop_opv_desc =
{ &cd9660_specop_p, cd9660_specop_entries };
@@ -1115,43 +1089,18 @@ struct vnodeopv_desc cd9660_specop_opv_desc =
#ifdef FIFO
int (**cd9660_fifoop_p)(void *);
struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
- { &vop_default_desc, vn_default_error },
- { &vop_lookup_desc, fifo_lookup }, /* lookup */
- { &vop_create_desc, fifo_create }, /* create */
- { &vop_mknod_desc, fifo_mknod }, /* mknod */
- { &vop_open_desc, fifo_open }, /* open */
- { &vop_close_desc, fifo_close }, /* close */
+ { &vop_default_desc, fifo_vnoperate },
{ &vop_access_desc, cd9660_access }, /* access */
{ &vop_getattr_desc, cd9660_getattr }, /* getattr */
{ &vop_setattr_desc, cd9660_setattr }, /* setattr */
- { &vop_read_desc, fifo_read }, /* read */
- { &vop_write_desc, fifo_write }, /* write */
- { &vop_lease_desc, fifo_lease_check }, /* lease */
- { &vop_ioctl_desc, fifo_ioctl }, /* ioctl */
- { &vop_select_desc, fifo_select }, /* select */
- { &vop_revoke_desc, fifo_revoke }, /* revoke */
- { &vop_fsync_desc, fifo_fsync }, /* fsync */
- { &vop_remove_desc, fifo_remove }, /* remove */
- { &vop_link_desc, fifo_link } , /* link */
- { &vop_rename_desc, fifo_rename }, /* rename */
- { &vop_mkdir_desc, fifo_mkdir }, /* mkdir */
- { &vop_rmdir_desc, fifo_rmdir }, /* rmdir */
- { &vop_symlink_desc, fifo_symlink }, /* symlink */
- { &vop_readdir_desc, fifo_readdir }, /* readdir */
- { &vop_readlink_desc, fifo_readlink }, /* readlink */
- { &vop_abortop_desc, fifo_abortop }, /* abortop */
{ &vop_inactive_desc, cd9660_inactive },/* inactive */
{ &vop_reclaim_desc, cd9660_reclaim }, /* reclaim */
{ &vop_lock_desc, cd9660_lock }, /* lock */
{ &vop_unlock_desc, cd9660_unlock }, /* unlock */
- { &vop_bmap_desc, fifo_bmap }, /* bmap */
- { &vop_strategy_desc, fifo_strategy }, /* strategy */
{ &vop_print_desc, cd9660_print }, /* print */
{ &vop_islocked_desc, cd9660_islocked },/* islocked */
- { &vop_pathconf_desc, fifo_pathconf }, /* pathconf */
- { &vop_advlock_desc, fifo_advlock }, /* advlock */
{ &vop_bwrite_desc, vop_generic_bwrite },
- { (struct vnodeop_desc*)NULL, (int(*)(void *))NULL }
+ { NULL, NULL }
};
struct vnodeopv_desc cd9660_fifoop_opv_desc =
{ &cd9660_fifoop_p, cd9660_fifoop_entries };