diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:13:32 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-02-27 07:13:32 +0000 |
commit | 16240c4ec5e2a3be1a664e6d9485e058fd0b6589 (patch) | |
tree | 1a7e09d5b03c266802292041c2882ddd89e0855d /sys/ufs/lfs/lfs_vnops.c | |
parent | e4dbdd3a19a2f75d54142f13bcadfed0617a7d12 (diff) |
From NetBSD: update to 960217 sources
Diffstat (limited to 'sys/ufs/lfs/lfs_vnops.c')
-rw-r--r-- | sys/ufs/lfs/lfs_vnops.c | 132 |
1 files changed, 74 insertions, 58 deletions
diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index 96ffcb47df3..24ed50153f7 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -1,4 +1,5 @@ -/* $NetBSD: lfs_vnops.c,v 1.7 1995/06/15 23:22:46 cgd Exp $ */ +/* $OpenBSD: lfs_vnops.c,v 1.2 1996/02/27 07:13:31 niklas Exp $ */ +/* $NetBSD: lfs_vnops.c,v 1.10 1996/02/09 22:28:59 christos Exp $ */ /* * Copyright (c) 1986, 1989, 1991, 1993 @@ -48,6 +49,7 @@ #include <sys/mount.h> #include <sys/vnode.h> #include <sys/malloc.h> +#include <sys/signalvar.h> #include <vm/vm.h> @@ -64,7 +66,7 @@ #include <ufs/lfs/lfs_extern.h> /* Global vfs data structures for lfs. */ -int (**lfs_vnodeop_p)(); +int (**lfs_vnodeop_p) __P((void *)); struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, ufs_lookup }, /* lookup */ @@ -109,12 +111,12 @@ struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_truncate_desc, lfs_truncate }, /* truncate */ { &vop_update_desc, lfs_update }, /* update */ { &vop_bwrite_desc, lfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc lfs_vnodeop_opv_desc = { &lfs_vnodeop_p, lfs_vnodeop_entries }; -int (**lfs_specop_p)(); +int (**lfs_specop_p) __P((void *)); struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, spec_lookup }, /* lookup */ @@ -158,13 +160,13 @@ struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_truncate_desc, spec_truncate }, /* truncate */ { &vop_update_desc, lfs_update }, /* update */ { &vop_bwrite_desc, lfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc lfs_specop_opv_desc = { &lfs_specop_p, lfs_specop_entries }; #ifdef FIFO -int (**lfs_fifoop_p)(); +int (**lfs_fifoop_p) __P((void *)); struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_default_desc, vn_default_error }, { &vop_lookup_desc, fifo_lookup }, /* lookup */ @@ -208,7 +210,7 @@ struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_truncate_desc, fifo_truncate }, /* truncate */ { &vop_update_desc, lfs_update }, /* update */ { &vop_bwrite_desc, lfs_bwrite }, /* bwrite */ - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + { (struct vnodeop_desc*)NULL, (int(*) __P((void *)))NULL } }; struct vnodeopv_desc lfs_fifoop_opv_desc = { &lfs_fifoop_p, lfs_fifoop_entries }; @@ -222,14 +224,16 @@ struct vnodeopv_desc lfs_fifoop_opv_desc = * Synch an open file. */ /* ARGSUSED */ -lfs_fsync(ap) +int +lfs_fsync(v) + void *v; +{ struct vop_fsync_args /* { struct vnode *a_vp; struct ucred *a_cred; int a_waitfor; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; struct timeval tv; tv = time; @@ -258,15 +262,16 @@ lfs_fsync(ap) #define MARK_VNODE(dvp) (dvp)->v_flag |= VDIROP int -lfs_symlink(ap) +lfs_symlink(v) + void *v; +{ struct vop_symlink_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; char *a_target; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -277,14 +282,15 @@ lfs_symlink(ap) } int -lfs_mknod(ap) +lfs_mknod(v) + void *v; +{ struct vop_mknod_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -295,14 +301,15 @@ lfs_mknod(ap) } int -lfs_create(ap) +lfs_create(v) + void *v; +{ struct vop_create_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -313,14 +320,15 @@ lfs_create(ap) } int -lfs_mkdir(ap) +lfs_mkdir(v) + void *v; +{ struct vop_mkdir_args /* { struct vnode *a_dvp; struct vnode **a_vpp; struct componentname *a_cnp; struct vattr *a_vap; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -331,13 +339,14 @@ lfs_mkdir(ap) } int -lfs_remove(ap) +lfs_remove(v) + void *v; +{ struct vop_remove_args /* { struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -349,14 +358,15 @@ lfs_remove(ap) } int -lfs_rmdir(ap) +lfs_rmdir(v) + void *v; +{ struct vop_rmdir_args /* { struct vnodeop_desc *a_desc; struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_dvp)->i_lfs); @@ -368,24 +378,27 @@ lfs_rmdir(ap) } int -lfs_link(ap) +lfs_link(v) + void *v; +{ struct vop_link_args /* { + struct vnode *a_dvp; struct vnode *a_vp; - struct vnode *a_tdvp; struct componentname *a_cnp; - } */ *ap; -{ + } */ *ap = v; int ret; - SET_DIROP(VTOI(ap->a_vp)->i_lfs); - MARK_VNODE(ap->a_vp); + SET_DIROP(VTOI(ap->a_dvp)->i_lfs); + MARK_VNODE(ap->a_dvp); ret = ufs_link(ap); - SET_ENDOP(VTOI(ap->a_vp)->i_lfs); + SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); return (ret); } - + int -lfs_rename(ap) +lfs_rename(v) + void *v; +{ struct vop_rename_args /* { struct vnode *a_fdvp; struct vnode *a_fvp; @@ -393,8 +406,7 @@ lfs_rename(ap) struct vnode *a_tdvp; struct vnode *a_tvp; struct componentname *a_tcnp; - } */ *ap; -{ + } */ *ap = v; int ret; SET_DIROP(VTOI(ap->a_fdvp)->i_lfs); @@ -406,14 +418,15 @@ lfs_rename(ap) } /* XXX hack to avoid calling ITIMES in getattr */ int -lfs_getattr(ap) +lfs_getattr(v) + void *v; +{ struct vop_getattr_args /* { struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct inode *ip = VTOI(vp); register struct vattr *vap = ap->a_vap; @@ -428,12 +441,12 @@ lfs_getattr(ap) vap->va_gid = ip->i_gid; vap->va_rdev = (dev_t)ip->i_rdev; vap->va_size = ip->i_din.di_size; - vap->va_atime.ts_sec = ip->i_atime; - vap->va_atime.ts_nsec = ip->i_atimensec; - vap->va_mtime.ts_sec = ip->i_mtime; - vap->va_mtime.ts_nsec = ip->i_mtimensec; - vap->va_ctime.ts_sec = ip->i_ctime; - vap->va_ctime.ts_nsec = ip->i_ctimensec; + vap->va_atime.tv_sec = ip->i_atime; + vap->va_atime.tv_nsec = ip->i_atimensec; + vap->va_mtime.tv_sec = ip->i_mtime; + vap->va_mtime.tv_nsec = ip->i_mtimensec; + vap->va_ctime.tv_sec = ip->i_ctime; + vap->va_ctime.tv_nsec = ip->i_ctimensec; vap->va_flags = ip->i_flags; vap->va_gen = ip->i_gen; /* this doesn't belong here */ @@ -457,14 +470,15 @@ lfs_getattr(ap) */ /* ARGSUSED */ int -lfs_close(ap) +lfs_close(v) + void *v; +{ struct vop_close_args /* { struct vnode *a_vp; int a_fflag; struct ucred *a_cred; struct proc *a_p; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; register struct inode *ip = VTOI(vp); int mod; @@ -484,11 +498,12 @@ lfs_close(ap) int lfs_no_inactive = 0; int -lfs_inactive(ap) +lfs_inactive(v) + void *v; +{ struct vop_inactive_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; if (lfs_no_inactive) return (0); @@ -499,15 +514,16 @@ lfs_inactive(ap) * Reclaim an inode so that it can be used for other purposes. */ int -lfs_reclaim(ap) +lfs_reclaim(v) + void *v; +{ struct vop_reclaim_args /* { struct vnode *a_vp; - } */ *ap; -{ + } */ *ap = v; register struct vnode *vp = ap->a_vp; int error; - if (error = ufs_reclaim(vp)) + if ((error = ufs_reclaim(vp)) != 0) return (error); FREE(vp->v_data, M_LFSNODE); vp->v_data = NULL; |