summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_vnops.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-11-09 08:17:23 +0000
committerbde <bde@FreeBSD.org>1995-11-09 08:17:23 +0000
commit449a11eb8852c894681575cf4226b1c639a2f9bc (patch)
treed1df2f42cd1cf04bc5757d3dff0d353c3e6a3a58 /sys/ufs/ffs/ffs_vnops.c
parent7b39ff1acd679291e1eaa968c4a256d7c6e3b22f (diff)
downloadFreeBSD-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/ufs/ffs/ffs_vnops.c')
-rw-r--r--sys/ufs/ffs/ffs_vnops.c270
1 files changed, 135 insertions, 135 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 2f49da7..30d5396 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vnops.c 8.7 (Berkeley) 2/3/94
- * $Id: ffs_vnops.c,v 1.15 1995/09/25 06:00:59 dyson Exp $
+ * $Id: ffs_vnops.c,v 1.16 1995/10/23 02:23:07 dyson Exp $
*/
#include <sys/param.h>
@@ -65,151 +65,151 @@
#include <ufs/ffs/ffs_extern.h>
/* Global vfs data structures for ufs. */
-int (**ffs_vnodeop_p)();
+vop_t **ffs_vnodeop_p;
struct vnodeopv_entry_desc ffs_vnodeop_entries[] = {
- { &vop_default_desc, vn_default_error },
- { &vop_lookup_desc, ufs_lookup }, /* lookup */
- { &vop_create_desc, ufs_create }, /* create */
- { &vop_mknod_desc, ufs_mknod }, /* mknod */
- { &vop_open_desc, ufs_open }, /* open */
- { &vop_close_desc, ufs_close }, /* close */
- { &vop_access_desc, ufs_access }, /* access */
- { &vop_getattr_desc, ufs_getattr }, /* getattr */
- { &vop_setattr_desc, ufs_setattr }, /* setattr */
- { &vop_read_desc, ffs_read }, /* read */
- { &vop_write_desc, ffs_write }, /* write */
- { &vop_ioctl_desc, ufs_ioctl }, /* ioctl */
- { &vop_select_desc, ufs_select }, /* select */
- { &vop_mmap_desc, ufs_mmap }, /* mmap */
- { &vop_fsync_desc, ffs_fsync }, /* fsync */
- { &vop_seek_desc, ufs_seek }, /* seek */
- { &vop_remove_desc, ufs_remove }, /* remove */
- { &vop_link_desc, ufs_link }, /* link */
- { &vop_rename_desc, ufs_rename }, /* rename */
- { &vop_mkdir_desc, ufs_mkdir }, /* mkdir */
- { &vop_rmdir_desc, ufs_rmdir }, /* rmdir */
- { &vop_symlink_desc, ufs_symlink }, /* symlink */
- { &vop_readdir_desc, ufs_readdir }, /* readdir */
- { &vop_readlink_desc, ufs_readlink }, /* readlink */
- { &vop_abortop_desc, ufs_abortop }, /* abortop */
- { &vop_inactive_desc, ufs_inactive }, /* inactive */
- { &vop_reclaim_desc, ufs_reclaim }, /* reclaim */
- { &vop_lock_desc, ufs_lock }, /* lock */
- { &vop_unlock_desc, ufs_unlock }, /* unlock */
- { &vop_bmap_desc, ufs_bmap }, /* bmap */
- { &vop_strategy_desc, ufs_strategy }, /* strategy */
- { &vop_print_desc, ufs_print }, /* print */
- { &vop_islocked_desc, ufs_islocked }, /* islocked */
- { &vop_pathconf_desc, ufs_pathconf }, /* pathconf */
- { &vop_advlock_desc, ufs_advlock }, /* advlock */
- { &vop_blkatoff_desc, ffs_blkatoff }, /* blkatoff */
- { &vop_valloc_desc, ffs_valloc }, /* valloc */
- { &vop_reallocblks_desc, ffs_reallocblks }, /* reallocblks */
- { &vop_vfree_desc, ffs_vfree }, /* vfree */
- { &vop_truncate_desc, ffs_truncate }, /* truncate */
- { &vop_update_desc, ffs_update }, /* update */
- { &vop_getpages_desc, ffs_getpages},
- { &vop_bwrite_desc, vn_bwrite },
- { (struct vnodeop_desc*)NULL, (int(*)())NULL }
+ { &vop_default_desc, (vop_t *)vn_default_error },
+ { &vop_lookup_desc, (vop_t *)ufs_lookup }, /* lookup */
+ { &vop_create_desc, (vop_t *)ufs_create }, /* create */
+ { &vop_mknod_desc, (vop_t *)ufs_mknod }, /* mknod */
+ { &vop_open_desc, (vop_t *)ufs_open }, /* open */
+ { &vop_close_desc, (vop_t *)ufs_close }, /* close */
+ { &vop_access_desc, (vop_t *)ufs_access }, /* access */
+ { &vop_getattr_desc, (vop_t *)ufs_getattr }, /* getattr */
+ { &vop_setattr_desc, (vop_t *)ufs_setattr }, /* setattr */
+ { &vop_read_desc, (vop_t *)ffs_read }, /* read */
+ { &vop_write_desc, (vop_t *)ffs_write }, /* write */
+ { &vop_ioctl_desc, (vop_t *)ufs_ioctl }, /* ioctl */
+ { &vop_select_desc, (vop_t *)ufs_select }, /* select */
+ { &vop_mmap_desc, (vop_t *)ufs_mmap }, /* mmap */
+ { &vop_fsync_desc, (vop_t *)ffs_fsync }, /* fsync */
+ { &vop_seek_desc, (vop_t *)ufs_seek }, /* seek */
+ { &vop_remove_desc, (vop_t *)ufs_remove }, /* remove */
+ { &vop_link_desc, (vop_t *)ufs_link }, /* link */
+ { &vop_rename_desc, (vop_t *)ufs_rename }, /* rename */
+ { &vop_mkdir_desc, (vop_t *)ufs_mkdir }, /* mkdir */
+ { &vop_rmdir_desc, (vop_t *)ufs_rmdir }, /* rmdir */
+ { &vop_symlink_desc, (vop_t *)ufs_symlink }, /* symlink */
+ { &vop_readdir_desc, (vop_t *)ufs_readdir }, /* readdir */
+ { &vop_readlink_desc, (vop_t *)ufs_readlink }, /* readlink */
+ { &vop_abortop_desc, (vop_t *)ufs_abortop }, /* abortop */
+ { &vop_inactive_desc, (vop_t *)ufs_inactive }, /* inactive */
+ { &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
+ { &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
+ { &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
+ { &vop_bmap_desc, (vop_t *)ufs_bmap }, /* bmap */
+ { &vop_strategy_desc, (vop_t *)ufs_strategy }, /* strategy */
+ { &vop_print_desc, (vop_t *)ufs_print }, /* print */
+ { &vop_islocked_desc, (vop_t *)ufs_islocked }, /* islocked */
+ { &vop_pathconf_desc, (vop_t *)ufs_pathconf }, /* pathconf */
+ { &vop_advlock_desc, (vop_t *)ufs_advlock }, /* advlock */
+ { &vop_blkatoff_desc, (vop_t *)ffs_blkatoff }, /* blkatoff */
+ { &vop_valloc_desc, (vop_t *)ffs_valloc }, /* valloc */
+ { &vop_reallocblks_desc, (vop_t *)ffs_reallocblks }, /* reallocblks */
+ { &vop_vfree_desc, (vop_t *)ffs_vfree }, /* vfree */
+ { &vop_truncate_desc, (vop_t *)ffs_truncate }, /* truncate */
+ { &vop_update_desc, (vop_t *)ffs_update }, /* update */
+ { &vop_getpages_desc, (vop_t *)ffs_getpages}, /* getpages */
+ { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */
+ { NULL, NULL }
};
struct vnodeopv_desc ffs_vnodeop_opv_desc =
{ &ffs_vnodeop_p, ffs_vnodeop_entries };
-int (**ffs_specop_p)();
+vop_t **ffs_specop_p;
struct vnodeopv_entry_desc ffs_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, ufsspec_close }, /* close */
- { &vop_access_desc, ufs_access }, /* access */
- { &vop_getattr_desc, ufs_getattr }, /* getattr */
- { &vop_setattr_desc, ufs_setattr }, /* setattr */
- { &vop_read_desc, ufsspec_read }, /* read */
- { &vop_write_desc, ufsspec_write }, /* write */
- { &vop_ioctl_desc, spec_ioctl }, /* ioctl */
- { &vop_select_desc, spec_select }, /* select */
- { &vop_mmap_desc, spec_mmap }, /* mmap */
- { &vop_fsync_desc, ffs_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, ufs_inactive }, /* inactive */
- { &vop_reclaim_desc, ufs_reclaim }, /* reclaim */
- { &vop_lock_desc, ufs_lock }, /* lock */
- { &vop_unlock_desc, ufs_unlock }, /* unlock */
- { &vop_bmap_desc, spec_bmap }, /* bmap */
- { &vop_strategy_desc, spec_strategy }, /* strategy */
- { &vop_print_desc, ufs_print }, /* print */
- { &vop_islocked_desc, ufs_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_reallocblks_desc, spec_reallocblks }, /* reallocblks */
- { &vop_vfree_desc, ffs_vfree }, /* vfree */
- { &vop_truncate_desc, spec_truncate }, /* truncate */
- { &vop_update_desc, ffs_update }, /* update */
- { &vop_getpages_desc, spec_getpages},
- { &vop_bwrite_desc, vn_bwrite },
- { (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 *)ufsspec_close }, /* close */
+ { &vop_access_desc, (vop_t *)ufs_access }, /* access */
+ { &vop_getattr_desc, (vop_t *)ufs_getattr }, /* getattr */
+ { &vop_setattr_desc, (vop_t *)ufs_setattr }, /* setattr */
+ { &vop_read_desc, (vop_t *)ufsspec_read }, /* read */
+ { &vop_write_desc, (vop_t *)ufsspec_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 *)ffs_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 *)ufs_inactive }, /* inactive */
+ { &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
+ { &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
+ { &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
+ { &vop_bmap_desc, (vop_t *)spec_bmap }, /* bmap */
+ { &vop_strategy_desc, (vop_t *)spec_strategy }, /* strategy */
+ { &vop_print_desc, (vop_t *)ufs_print }, /* print */
+ { &vop_islocked_desc, (vop_t *)ufs_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_reallocblks_desc, (vop_t *)spec_reallocblks }, /* reallocblks */
+ { &vop_vfree_desc, (vop_t *)ffs_vfree }, /* vfree */
+ { &vop_truncate_desc, (vop_t *)spec_truncate }, /* truncate */
+ { &vop_update_desc, (vop_t *)ffs_update }, /* update */
+ { &vop_getpages_desc, (vop_t *)spec_getpages}, /* getpages */
+ { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */
+ { NULL, NULL }
};
struct vnodeopv_desc ffs_specop_opv_desc =
{ &ffs_specop_p, ffs_specop_entries };
-int (**ffs_fifoop_p)();
+vop_t **ffs_fifoop_p;
struct vnodeopv_entry_desc ffs_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, ufsfifo_close }, /* close */
- { &vop_access_desc, ufs_access }, /* access */
- { &vop_getattr_desc, ufs_getattr }, /* getattr */
- { &vop_setattr_desc, ufs_setattr }, /* setattr */
- { &vop_read_desc, ufsfifo_read }, /* read */
- { &vop_write_desc, ufsfifo_write }, /* write */
- { &vop_ioctl_desc, fifo_ioctl }, /* ioctl */
- { &vop_select_desc, fifo_select }, /* select */
- { &vop_mmap_desc, fifo_mmap }, /* mmap */
- { &vop_fsync_desc, ffs_fsync }, /* fsync */
- { &vop_seek_desc, fifo_seek }, /* seek */
- { &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, ufs_inactive }, /* inactive */
- { &vop_reclaim_desc, ufs_reclaim }, /* reclaim */
- { &vop_lock_desc, ufs_lock }, /* lock */
- { &vop_unlock_desc, ufs_unlock }, /* unlock */
- { &vop_bmap_desc, fifo_bmap }, /* bmap */
- { &vop_strategy_desc, fifo_strategy }, /* strategy */
- { &vop_print_desc, ufs_print }, /* print */
- { &vop_islocked_desc, ufs_islocked }, /* islocked */
- { &vop_pathconf_desc, fifo_pathconf }, /* pathconf */
- { &vop_advlock_desc, fifo_advlock }, /* advlock */
- { &vop_blkatoff_desc, fifo_blkatoff }, /* blkatoff */
- { &vop_valloc_desc, fifo_valloc }, /* valloc */
- { &vop_reallocblks_desc, fifo_reallocblks }, /* reallocblks */
- { &vop_vfree_desc, ffs_vfree }, /* vfree */
- { &vop_truncate_desc, fifo_truncate }, /* truncate */
- { &vop_update_desc, ffs_update }, /* update */
- { &vop_bwrite_desc, vn_bwrite },
- { (struct vnodeop_desc*)NULL, (int(*)())NULL }
+ { &vop_default_desc, (vop_t *)vn_default_error },
+ { &vop_lookup_desc, (vop_t *)fifo_lookup }, /* lookup */
+ { &vop_create_desc, (vop_t *)fifo_create }, /* create */
+ { &vop_mknod_desc, (vop_t *)fifo_mknod }, /* mknod */
+ { &vop_open_desc, (vop_t *)fifo_open }, /* open */
+ { &vop_close_desc, (vop_t *)ufsfifo_close }, /* close */
+ { &vop_access_desc, (vop_t *)ufs_access }, /* access */
+ { &vop_getattr_desc, (vop_t *)ufs_getattr }, /* getattr */
+ { &vop_setattr_desc, (vop_t *)ufs_setattr }, /* setattr */
+ { &vop_read_desc, (vop_t *)ufsfifo_read }, /* read */
+ { &vop_write_desc, (vop_t *)ufsfifo_write }, /* write */
+ { &vop_ioctl_desc, (vop_t *)fifo_ioctl }, /* ioctl */
+ { &vop_select_desc, (vop_t *)fifo_select }, /* select */
+ { &vop_mmap_desc, (vop_t *)fifo_mmap }, /* mmap */
+ { &vop_fsync_desc, (vop_t *)ffs_fsync }, /* fsync */
+ { &vop_seek_desc, (vop_t *)fifo_seek }, /* seek */
+ { &vop_remove_desc, (vop_t *)fifo_remove }, /* remove */
+ { &vop_link_desc, (vop_t *)fifo_link }, /* link */
+ { &vop_rename_desc, (vop_t *)fifo_rename }, /* rename */
+ { &vop_mkdir_desc, (vop_t *)fifo_mkdir }, /* mkdir */
+ { &vop_rmdir_desc, (vop_t *)fifo_rmdir }, /* rmdir */
+ { &vop_symlink_desc, (vop_t *)fifo_symlink }, /* symlink */
+ { &vop_readdir_desc, (vop_t *)fifo_readdir }, /* readdir */
+ { &vop_readlink_desc, (vop_t *)fifo_readlink }, /* readlink */
+ { &vop_abortop_desc, (vop_t *)fifo_abortop }, /* abortop */
+ { &vop_inactive_desc, (vop_t *)ufs_inactive }, /* inactive */
+ { &vop_reclaim_desc, (vop_t *)ufs_reclaim }, /* reclaim */
+ { &vop_lock_desc, (vop_t *)ufs_lock }, /* lock */
+ { &vop_unlock_desc, (vop_t *)ufs_unlock }, /* unlock */
+ { &vop_bmap_desc, (vop_t *)fifo_bmap }, /* bmap */
+ { &vop_strategy_desc, (vop_t *)fifo_strategy }, /* strategy */
+ { &vop_print_desc, (vop_t *)ufs_print }, /* print */
+ { &vop_islocked_desc, (vop_t *)ufs_islocked }, /* islocked */
+ { &vop_pathconf_desc, (vop_t *)fifo_pathconf }, /* pathconf */
+ { &vop_advlock_desc, (vop_t *)fifo_advlock }, /* advlock */
+ { &vop_blkatoff_desc, (vop_t *)fifo_blkatoff }, /* blkatoff */
+ { &vop_valloc_desc, (vop_t *)fifo_valloc }, /* valloc */
+ { &vop_reallocblks_desc, (vop_t *)fifo_reallocblks }, /* reallocblks */
+ { &vop_vfree_desc, (vop_t *)ffs_vfree }, /* vfree */
+ { &vop_truncate_desc, (vop_t *)fifo_truncate }, /* truncate */
+ { &vop_update_desc, (vop_t *)ffs_update }, /* update */
+ { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */
+ { NULL, NULL }
};
struct vnodeopv_desc ffs_fifoop_opv_desc =
{ &ffs_fifoop_p, ffs_fifoop_entries };
OpenPOWER on IntegriCloud