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/fs/procfs | |
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/fs/procfs')
-rw-r--r-- | sys/fs/procfs/procfs.h | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 86 |
2 files changed, 45 insertions, 45 deletions
diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index 4632f2b..f21813f 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/procfs/procfs.h @@ -36,7 +36,7 @@ * * @(#)procfs.h 8.6 (Berkeley) 2/3/94 * - * $Id: procfs.h,v 1.5 1995/05/25 01:35:22 davidg Exp $ + * $Id: procfs.h,v 1.6 1995/11/07 13:39:29 phk Exp $ */ /* @@ -137,7 +137,7 @@ extern int procfs_dostatus __P((struct proc *, struct proc *, struct pfsnode *pf #define PROCFS_LOCKED 0x01 #define PROCFS_WANT 0x02 -extern int (**procfs_vnodeop_p)(); +extern vop_t **procfs_vnodeop_p; extern struct vfsops procfs_vfsops; int procfs_root __P((struct mount *, struct vnode **)); diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index c421569..fa3f0d4 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.16 1995/09/02 18:28:48 mpp Exp $ + * $Id: procfs_vnops.c,v 1.17 1995/11/07 13:39:31 phk Exp $ */ /* @@ -799,49 +799,49 @@ atopid(b, len) /* * procfs vnode operations. */ -int (**procfs_vnodeop_p)(); +vop_t **procfs_vnodeop_p; static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { - { &vop_default_desc, vn_default_error }, - { &vop_lookup_desc, procfs_lookup }, /* lookup */ - { &vop_create_desc, procfs_create }, /* create */ - { &vop_mknod_desc, procfs_mknod }, /* mknod */ - { &vop_open_desc, procfs_open }, /* open */ - { &vop_close_desc, procfs_close }, /* close */ - { &vop_access_desc, procfs_access }, /* access */ - { &vop_getattr_desc, procfs_getattr }, /* getattr */ - { &vop_setattr_desc, procfs_setattr }, /* setattr */ - { &vop_read_desc, procfs_read }, /* read */ - { &vop_write_desc, procfs_write }, /* write */ - { &vop_ioctl_desc, procfs_ioctl }, /* ioctl */ - { &vop_select_desc, procfs_select }, /* select */ - { &vop_mmap_desc, procfs_mmap }, /* mmap */ - { &vop_fsync_desc, procfs_fsync }, /* fsync */ - { &vop_seek_desc, procfs_seek }, /* seek */ - { &vop_remove_desc, procfs_remove }, /* remove */ - { &vop_link_desc, procfs_link }, /* link */ - { &vop_rename_desc, procfs_rename }, /* rename */ - { &vop_mkdir_desc, procfs_mkdir }, /* mkdir */ - { &vop_rmdir_desc, procfs_rmdir }, /* rmdir */ - { &vop_symlink_desc, procfs_symlink }, /* symlink */ - { &vop_readdir_desc, procfs_readdir }, /* readdir */ - { &vop_readlink_desc, procfs_readlink }, /* readlink */ - { &vop_abortop_desc, procfs_abortop }, /* abortop */ - { &vop_inactive_desc, procfs_inactive }, /* inactive */ - { &vop_reclaim_desc, procfs_reclaim }, /* reclaim */ - { &vop_lock_desc, procfs_lock }, /* lock */ - { &vop_unlock_desc, procfs_unlock }, /* unlock */ - { &vop_bmap_desc, procfs_bmap }, /* bmap */ - { &vop_strategy_desc, procfs_strategy }, /* strategy */ - { &vop_print_desc, procfs_print }, /* print */ - { &vop_islocked_desc, procfs_islocked }, /* islocked */ - { &vop_pathconf_desc, procfs_pathconf }, /* pathconf */ - { &vop_advlock_desc, procfs_advlock }, /* advlock */ - { &vop_blkatoff_desc, procfs_blkatoff }, /* blkatoff */ - { &vop_valloc_desc, procfs_valloc }, /* valloc */ - { &vop_vfree_desc, procfs_vfree }, /* vfree */ - { &vop_truncate_desc, procfs_truncate }, /* truncate */ - { &vop_update_desc, procfs_update }, /* update */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { &vop_default_desc, (vop_t *)vn_default_error }, + { &vop_lookup_desc, (vop_t *)procfs_lookup }, /* lookup */ + { &vop_create_desc, (vop_t *)procfs_create }, /* create */ + { &vop_mknod_desc, (vop_t *)procfs_mknod }, /* mknod */ + { &vop_open_desc, (vop_t *)procfs_open }, /* open */ + { &vop_close_desc, (vop_t *)procfs_close }, /* close */ + { &vop_access_desc, (vop_t *)procfs_access }, /* access */ + { &vop_getattr_desc, (vop_t *)procfs_getattr }, /* getattr */ + { &vop_setattr_desc, (vop_t *)procfs_setattr }, /* setattr */ + { &vop_read_desc, (vop_t *)procfs_read }, /* read */ + { &vop_write_desc, (vop_t *)procfs_write }, /* write */ + { &vop_ioctl_desc, (vop_t *)procfs_ioctl }, /* ioctl */ + { &vop_select_desc, (vop_t *)procfs_select }, /* select */ + { &vop_mmap_desc, (vop_t *)procfs_mmap }, /* mmap */ + { &vop_fsync_desc, (vop_t *)procfs_fsync }, /* fsync */ + { &vop_seek_desc, (vop_t *)procfs_seek }, /* seek */ + { &vop_remove_desc, (vop_t *)procfs_remove }, /* remove */ + { &vop_link_desc, (vop_t *)procfs_link }, /* link */ + { &vop_rename_desc, (vop_t *)procfs_rename }, /* rename */ + { &vop_mkdir_desc, (vop_t *)procfs_mkdir }, /* mkdir */ + { &vop_rmdir_desc, (vop_t *)procfs_rmdir }, /* rmdir */ + { &vop_symlink_desc, (vop_t *)procfs_symlink }, /* symlink */ + { &vop_readdir_desc, (vop_t *)procfs_readdir }, /* readdir */ + { &vop_readlink_desc, (vop_t *)procfs_readlink }, /* readlink */ + { &vop_abortop_desc, (vop_t *)procfs_abortop }, /* abortop */ + { &vop_inactive_desc, (vop_t *)procfs_inactive }, /* inactive */ + { &vop_reclaim_desc, (vop_t *)procfs_reclaim }, /* reclaim */ + { &vop_lock_desc, (vop_t *)procfs_lock }, /* lock */ + { &vop_unlock_desc, (vop_t *)procfs_unlock }, /* unlock */ + { &vop_bmap_desc, (vop_t *)procfs_bmap }, /* bmap */ + { &vop_strategy_desc, (vop_t *)procfs_strategy }, /* strategy */ + { &vop_print_desc, (vop_t *)procfs_print }, /* print */ + { &vop_islocked_desc, (vop_t *)procfs_islocked }, /* islocked */ + { &vop_pathconf_desc, (vop_t *)procfs_pathconf }, /* pathconf */ + { &vop_advlock_desc, (vop_t *)procfs_advlock }, /* advlock */ + { &vop_blkatoff_desc, (vop_t *)procfs_blkatoff }, /* blkatoff */ + { &vop_valloc_desc, (vop_t *)procfs_valloc }, /* valloc */ + { &vop_vfree_desc, (vop_t *)procfs_vfree }, /* vfree */ + { &vop_truncate_desc, (vop_t *)procfs_truncate }, /* truncate */ + { &vop_update_desc, (vop_t *)procfs_update }, /* update */ + { NULL, NULL } }; static struct vnodeopv_desc procfs_vnodeop_opv_desc = { &procfs_vnodeop_p, procfs_vnodeop_entries }; |