diff options
author | bde <bde@FreeBSD.org> | 1995-11-09 08:17:23 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-11-09 08:17:23 +0000 |
commit | 449a11eb8852c894681575cf4226b1c639a2f9bc (patch) | |
tree | d1df2f42cd1cf04bc5757d3dff0d353c3e6a3a58 /sys/miscfs/specfs | |
parent | 7b39ff1acd679291e1eaa968c4a256d7c6e3b22f (diff) | |
download | FreeBSD-src-449a11eb8852c894681575cf4226b1c639a2f9bc.zip FreeBSD-src-449a11eb8852c894681575cf4226b1c639a2f9bc.tar.gz |
Introduced a type `vop_t' for vnode operation functions and used
it 1138 times (:-() in casts and a few more times in declarations.
This change is null for the i386.
The type has to be `typedef int vop_t(void *)' and not `typedef
int vop_t()' because `gcc -Wstrict-prototypes' warns about the
latter. Since vnode op functions are called with args of different
(struct pointer) types, neither of these function types is any use
for type checking of the arg, so it would be preferable not to use
the complete function type, especially since using the complete
type requires adding 1138 casts to avoid compiler warnings and
another 40+ casts to reverse the function pointer conversions before
calling the functions.
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 90 | ||||
-rw-r--r-- | sys/miscfs/specfs/specdev.h | 4 |
2 files changed, 47 insertions, 47 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index c7430b5..b9ed634 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.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.15 1995/10/06 09:47:58 phk Exp $ + * $Id: spec_vnops.c,v 1.16 1995/10/23 02:22:47 dyson Exp $ */ #include <sys/param.h> @@ -51,51 +51,51 @@ #include <miscfs/specfs/specdev.h> struct vnode *speclisth[SPECHSZ]; -int (**spec_vnodeop_p)(); +vop_t **spec_vnodeop_p; struct vnodeopv_entry_desc spec_vnodeop_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_access_desc, spec_access }, /* access */ - { &vop_getattr_desc, spec_getattr }, /* getattr */ - { &vop_setattr_desc, spec_setattr }, /* setattr */ - { &vop_read_desc, spec_read }, /* read */ - { &vop_write_desc, spec_write }, /* write */ - { &vop_ioctl_desc, spec_ioctl }, /* ioctl */ - { &vop_select_desc, spec_select }, /* select */ - { &vop_mmap_desc, spec_mmap }, /* mmap */ - { &vop_fsync_desc, spec_fsync }, /* fsync */ - { &vop_seek_desc, spec_seek }, /* seek */ - { &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, spec_inactive }, /* inactive */ - { &vop_reclaim_desc, spec_reclaim }, /* reclaim */ - { &vop_lock_desc, spec_lock }, /* lock */ - { &vop_unlock_desc, spec_unlock }, /* unlock */ - { &vop_bmap_desc, spec_bmap }, /* bmap */ - { &vop_strategy_desc, spec_strategy }, /* strategy */ - { &vop_print_desc, spec_print }, /* print */ - { &vop_islocked_desc, spec_islocked }, /* islocked */ - { &vop_pathconf_desc, spec_pathconf }, /* pathconf */ - { &vop_advlock_desc, spec_advlock }, /* advlock */ - { &vop_blkatoff_desc, spec_blkatoff }, /* blkatoff */ - { &vop_valloc_desc, spec_valloc }, /* valloc */ - { &vop_vfree_desc, spec_vfree }, /* vfree */ - { &vop_truncate_desc, spec_truncate }, /* truncate */ - { &vop_update_desc, spec_update }, /* update */ - { &vop_bwrite_desc, vn_bwrite }, /* bwrite */ - { &vop_getpages_desc, spec_getpages}, /* getpages */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { &vop_default_desc, (vop_t *)vn_default_error }, + { &vop_lookup_desc, (vop_t *)spec_lookup }, /* lookup */ + { &vop_create_desc, (vop_t *)spec_create }, /* create */ + { &vop_mknod_desc, (vop_t *)spec_mknod }, /* mknod */ + { &vop_open_desc, (vop_t *)spec_open }, /* open */ + { &vop_close_desc, (vop_t *)spec_close }, /* close */ + { &vop_access_desc, (vop_t *)spec_access }, /* access */ + { &vop_getattr_desc, (vop_t *)spec_getattr }, /* getattr */ + { &vop_setattr_desc, (vop_t *)spec_setattr }, /* setattr */ + { &vop_read_desc, (vop_t *)spec_read }, /* read */ + { &vop_write_desc, (vop_t *)spec_write }, /* write */ + { &vop_ioctl_desc, (vop_t *)spec_ioctl }, /* ioctl */ + { &vop_select_desc, (vop_t *)spec_select }, /* select */ + { &vop_mmap_desc, (vop_t *)spec_mmap }, /* mmap */ + { &vop_fsync_desc, (vop_t *)spec_fsync }, /* fsync */ + { &vop_seek_desc, (vop_t *)spec_seek }, /* seek */ + { &vop_remove_desc, (vop_t *)spec_remove }, /* remove */ + { &vop_link_desc, (vop_t *)spec_link }, /* link */ + { &vop_rename_desc, (vop_t *)spec_rename }, /* rename */ + { &vop_mkdir_desc, (vop_t *)spec_mkdir }, /* mkdir */ + { &vop_rmdir_desc, (vop_t *)spec_rmdir }, /* rmdir */ + { &vop_symlink_desc, (vop_t *)spec_symlink }, /* symlink */ + { &vop_readdir_desc, (vop_t *)spec_readdir }, /* readdir */ + { &vop_readlink_desc, (vop_t *)spec_readlink }, /* readlink */ + { &vop_abortop_desc, (vop_t *)spec_abortop }, /* abortop */ + { &vop_inactive_desc, (vop_t *)spec_inactive }, /* inactive */ + { &vop_reclaim_desc, (vop_t *)spec_reclaim }, /* reclaim */ + { &vop_lock_desc, (vop_t *)spec_lock }, /* lock */ + { &vop_unlock_desc, (vop_t *)spec_unlock }, /* unlock */ + { &vop_bmap_desc, (vop_t *)spec_bmap }, /* bmap */ + { &vop_strategy_desc, (vop_t *)spec_strategy }, /* strategy */ + { &vop_print_desc, (vop_t *)spec_print }, /* print */ + { &vop_islocked_desc, (vop_t *)spec_islocked }, /* islocked */ + { &vop_pathconf_desc, (vop_t *)spec_pathconf }, /* pathconf */ + { &vop_advlock_desc, (vop_t *)spec_advlock }, /* advlock */ + { &vop_blkatoff_desc, (vop_t *)spec_blkatoff }, /* blkatoff */ + { &vop_valloc_desc, (vop_t *)spec_valloc }, /* valloc */ + { &vop_vfree_desc, (vop_t *)spec_vfree }, /* vfree */ + { &vop_truncate_desc, (vop_t *)spec_truncate }, /* truncate */ + { &vop_update_desc, (vop_t *)spec_update }, /* update */ + { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ + { &vop_getpages_desc, (vop_t *)spec_getpages}, /* getpages */ + { NULL, NULL } }; struct vnodeopv_desc spec_vnodeop_opv_desc = { &spec_vnodeop_p, spec_vnodeop_entries }; diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index 3ef7359..01a799b 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)specdev.h 8.2 (Berkeley) 2/2/94 - * $Id: specdev.h,v 1.3 1995/07/29 11:40:32 bde Exp $ + * $Id: specdev.h,v 1.4 1995/10/23 02:22:51 dyson Exp $ */ /* @@ -73,7 +73,7 @@ extern struct vnode *speclisth[SPECHSZ]; /* * Prototypes for special file operations on vnodes. */ -extern int (**spec_vnodeop_p)(); +extern vop_t **spec_vnodeop_p; struct nameidata; struct componentname; struct ucred; |