diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:49:44 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:49:44 +0000 |
commit | 35b42ab3de609e79e7fed3f6212684bf7edeadba (patch) | |
tree | ba901b57c856761701f3c7a41f50d070a217fb0f /sys | |
parent | e1d50524a19b291d7ddb25c7d05b8086df55b1c0 (diff) |
From NetBSD: update to 960217 sources
Diffstat (limited to 'sys')
-rw-r--r-- | sys/miscfs/deadfs/dead_vnops.c | 218 |
1 files changed, 112 insertions, 106 deletions
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index 374bd4e3586..0d44c0bbff7 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: dead_vnops.c,v 1.13 1995/04/10 00:48:46 mycroft Exp $ */ +/* $OpenBSD: dead_vnops.c,v 1.2 1996/02/27 07:49:43 niklas Exp $ */ +/* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,73 +43,78 @@ #include <sys/errno.h> #include <sys/namei.h> #include <sys/buf.h> +#include <sys/proc.h> /* * Prototypes for dead operations on vnodes. */ -int dead_badop(), - dead_ebadf(); -int dead_lookup __P((struct vop_lookup_args *)); -#define dead_create ((int (*) __P((struct vop_create_args *)))dead_badop) -#define dead_mknod ((int (*) __P((struct vop_mknod_args *)))dead_badop) -int dead_open __P((struct vop_open_args *)); -#define dead_close ((int (*) __P((struct vop_close_args *)))nullop) -#define dead_access ((int (*) __P((struct vop_access_args *)))dead_ebadf) -#define dead_getattr ((int (*) __P((struct vop_getattr_args *)))dead_ebadf) -#define dead_setattr ((int (*) __P((struct vop_setattr_args *)))dead_ebadf) -int dead_read __P((struct vop_read_args *)); -int dead_write __P((struct vop_write_args *)); -int dead_ioctl __P((struct vop_ioctl_args *)); -int dead_select __P((struct vop_select_args *)); -#define dead_mmap ((int (*) __P((struct vop_mmap_args *)))dead_badop) -#define dead_fsync ((int (*) __P((struct vop_fsync_args *)))nullop) -#define dead_seek ((int (*) __P((struct vop_seek_args *)))nullop) -#define dead_remove ((int (*) __P((struct vop_remove_args *)))dead_badop) -#define dead_link ((int (*) __P((struct vop_link_args *)))dead_badop) -#define dead_rename ((int (*) __P((struct vop_rename_args *)))dead_badop) -#define dead_mkdir ((int (*) __P((struct vop_mkdir_args *)))dead_badop) -#define dead_rmdir ((int (*) __P((struct vop_rmdir_args *)))dead_badop) -#define dead_symlink ((int (*) __P((struct vop_symlink_args *)))dead_badop) -#define dead_readdir ((int (*) __P((struct vop_readdir_args *)))dead_ebadf) -#define dead_readlink ((int (*) __P((struct vop_readlink_args *)))dead_ebadf) -#define dead_abortop ((int (*) __P((struct vop_abortop_args *)))dead_badop) -#define dead_inactive ((int (*) __P((struct vop_inactive_args *)))nullop) -#define dead_reclaim ((int (*) __P((struct vop_reclaim_args *)))nullop) -int dead_lock __P((struct vop_lock_args *)); -#define dead_unlock ((int (*) __P((struct vop_unlock_args *)))nullop) -int dead_bmap __P((struct vop_bmap_args *)); -int dead_strategy __P((struct vop_strategy_args *)); -int dead_print __P((struct vop_print_args *)); -#define dead_islocked ((int (*) __P((struct vop_islocked_args *)))nullop) -#define dead_pathconf ((int (*) __P((struct vop_pathconf_args *)))dead_ebadf) -#define dead_advlock ((int (*) __P((struct vop_advlock_args *)))dead_ebadf) -#define dead_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))dead_badop) -#define dead_valloc ((int (*) __P((struct vop_valloc_args *)))dead_badop) -#define dead_vfree ((int (*) __P((struct vop_vfree_args *)))dead_badop) -#define dead_truncate ((int (*) __P((struct vop_truncate_args *)))nullop) -#define dead_update ((int (*) __P((struct vop_update_args *)))nullop) -#define dead_bwrite ((int (*) __P((struct vop_bwrite_args *)))nullop) +int dead_badop __P((void *)); +int dead_ebadf __P((void *)); + +int dead_lookup __P((void *)); +#define dead_create dead_badop +#define dead_mknod dead_badop +int dead_open __P((void *)); +#define dead_close nullop +#define dead_access dead_ebadf +#define dead_getattr dead_ebadf +#define dead_setattr dead_ebadf +int dead_read __P((void *)); +int dead_write __P((void *)); +int dead_ioctl __P((void *)); +int dead_select __P((void *)); +#define dead_mmap dead_badop +#define dead_fsync nullop +#define dead_seek nullop +#define dead_remove dead_badop +#define dead_link dead_badop +#define dead_rename dead_badop +#define dead_mkdir dead_badop +#define dead_rmdir dead_badop +#define dead_symlink dead_badop +#define dead_readdir dead_ebadf +#define dead_readlink dead_ebadf +#define dead_abortop dead_badop +#define dead_inactive nullop +#define dead_reclaim nullop +int dead_lock __P((void *)); +#define dead_unlock nullop +int dead_bmap __P((void *)); +int dead_strategy __P((void *)); +int dead_print __P((void *)); +#define dead_islocked nullop +#define dead_pathconf dead_ebadf +#define dead_advlock dead_ebadf +#define dead_blkatoff dead_badop +#define dead_valloc dead_badop +#define dead_vfree dead_badop +#define dead_truncate nullop +#define dead_update nullop +#define dead_bwrite nullop + +int chkvnlock __P((struct vnode *)); + +int (**dead_vnodeop_p) __P((void *)); -int (**dead_vnodeop_p)(); struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, dead_lookup }, /* lookup */ { &vop_create_desc, dead_create }, /* create */ { &vop_mknod_desc, dead_mknod }, /* mknod */ - { &vop_open_desc, dead_open }, /* open */ + { &vop_open_desc, dead_open }, /* open */ { &vop_close_desc, dead_close }, /* close */ { &vop_access_desc, dead_access }, /* access */ { &vop_getattr_desc, dead_getattr }, /* getattr */ { &vop_setattr_desc, dead_setattr }, /* setattr */ - { &vop_read_desc, dead_read }, /* read */ + { &vop_read_desc, dead_read }, /* read */ { &vop_write_desc, dead_write }, /* write */ { &vop_ioctl_desc, dead_ioctl }, /* ioctl */ { &vop_select_desc, dead_select }, /* select */ - { &vop_mmap_desc, dead_mmap }, /* mmap */ + { &vop_mmap_desc, dead_mmap }, /* mmap */ { &vop_fsync_desc, dead_fsync }, /* fsync */ - { &vop_seek_desc, dead_seek }, /* seek */ + { &vop_seek_desc, dead_seek }, /* seek */ { &vop_remove_desc, dead_remove }, /* remove */ - { &vop_link_desc, dead_link }, /* link */ + { &vop_link_desc, dead_link }, /* link */ { &vop_rename_desc, dead_rename }, /* rename */ { &vop_mkdir_desc, dead_mkdir }, /* mkdir */ { &vop_rmdir_desc, dead_rmdir }, /* rmdir */ @@ -118,9 +124,9 @@ struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_abortop_desc, dead_abortop }, /* abortop */ { &vop_inactive_desc, dead_inactive }, /* inactive */ { &vop_reclaim_desc, dead_reclaim }, /* reclaim */ - { &vop_lock_desc, dead_lock }, /* lock */ + { &vop_lock_desc, dead_lock }, /* lock */ { &vop_unlock_desc, dead_unlock }, /* unlock */ - { &vop_bmap_desc, dead_bmap }, /* bmap */ + { &vop_bmap_desc, dead_bmap }, /* bmap */ { &vop_strategy_desc, dead_strategy }, /* strategy */ { &vop_print_desc, dead_print }, /* print */ { &vop_islocked_desc, dead_islocked }, /* islocked */ @@ -132,7 +138,7 @@ struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_truncate_desc, dead_truncate }, /* truncate */ { &vop_update_desc, dead_update }, /* update */ { &vop_bwrite_desc, dead_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc dead_vnodeop_opv_desc = { &dead_vnodeop_p, dead_vnodeop_entries }; @@ -142,13 +148,14 @@ struct vnodeopv_desc dead_vnodeop_opv_desc = */ /* ARGSUSED */ int -dead_lookup(ap) +dead_lookup(v) + void *v; +{ struct vop_lookup_args /* { struct vnode * a_dvp; struct vnode ** a_vpp; struct componentname * a_cnp; - } */ *ap; -{ + } */ *ap = v; *ap->a_vpp = NULL; return (ENOTDIR); @@ -158,13 +165,9 @@ dead_lookup(ap) * Open always fails as if device did not exist. */ /* ARGSUSED */ -dead_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +int +dead_open(v) + void *v; { return (ENXIO); @@ -174,14 +177,16 @@ dead_open(ap) * Vnode op for read */ /* ARGSUSED */ -dead_read(ap) +int +dead_read(v) + void *v; +{ struct vop_read_args /* { struct vnode *a_vp; struct uio *a_uio; int a_ioflag; struct ucred *a_cred; - } */ *ap; -{ + } */ *ap = v; if (chkvnlock(ap->a_vp)) panic("dead_read: lock"); @@ -197,14 +202,16 @@ dead_read(ap) * Vnode op for write */ /* ARGSUSED */ -dead_write(ap) +int +dead_write(v) + void *v; +{ struct vop_write_args /* { struct vnode *a_vp; struct uio *a_uio; int a_ioflag; struct ucred *a_cred; - } */ *ap; -{ + } */ *ap = v; if (chkvnlock(ap->a_vp)) panic("dead_write: lock"); @@ -215,7 +222,10 @@ dead_write(ap) * Device ioctl operation. */ /* ARGSUSED */ -dead_ioctl(ap) +int +dead_ioctl(v) + void *v; +{ struct vop_ioctl_args /* { struct vnode *a_vp; u_long a_command; @@ -223,8 +233,7 @@ dead_ioctl(ap) int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; if (!chkvnlock(ap->a_vp)) return (EBADF); @@ -232,16 +241,10 @@ dead_ioctl(ap) } /* ARGSUSED */ -dead_select(ap) - struct vop_select_args /* { - struct vnode *a_vp; - int a_which; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; +int +dead_select(v) + void *v; { - /* * Let the user find out that the descriptor is gone. */ @@ -251,12 +254,14 @@ dead_select(ap) /* * Just call the device strategy routine */ -dead_strategy(ap) - struct vop_strategy_args /* { - struct buf *a_bp; - } */ *ap; +int +dead_strategy(v) + void *v; { + struct vop_strategy_args /* { + struct buf *a_bp; + } */ *ap = v; if (ap->a_bp->b_vp == NULL || !chkvnlock(ap->a_bp->b_vp)) { ap->a_bp->b_flags |= B_ERROR; biodone(ap->a_bp); @@ -268,11 +273,13 @@ dead_strategy(ap) /* * Wait until the vnode has finished changing state. */ -dead_lock(ap) +int +dead_lock(v) + void *v; +{ struct vop_lock_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; if (!chkvnlock(ap->a_vp)) return (0); @@ -282,15 +289,17 @@ dead_lock(ap) /* * Wait until the vnode has finished changing state. */ -dead_bmap(ap) +int +dead_bmap(v) + void *v; +{ struct vop_bmap_args /* { struct vnode *a_vp; daddr_t a_bn; struct vnode **a_vpp; daddr_t *a_bnp; int *a_runp; - } */ *ap; -{ + } */ *ap = v; if (!chkvnlock(ap->a_vp)) return (EIO); @@ -301,19 +310,21 @@ dead_bmap(ap) * Print out the contents of a dead vnode. */ /* ARGSUSED */ -dead_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; +int +dead_print(v) + void *v; { - printf("tag VT_NON, dead vnode\n"); + return 0; } /* * Empty vnode failed operation */ -dead_ebadf() +/*ARGSUSED*/ +int +dead_ebadf(v) + void *v; { return (EBADF); @@ -322,7 +333,10 @@ dead_ebadf() /* * Empty vnode bad operation */ -dead_badop() +/*ARGSUSED*/ +int +dead_badop(v) + void *v; { panic("dead_badop called"); @@ -330,18 +344,10 @@ dead_badop() } /* - * Empty vnode null operation - */ -dead_nullop() -{ - - return (0); -} - -/* * We have to wait during times when the vnode is * in a state of change. */ +int chkvnlock(vp) register struct vnode *vp; { |