LK_INTERLOCK is no longer a valid flag for VOP_LOCK().

This commit is contained in:
hannken 2010-07-02 07:56:46 +00:00
parent fe98792097
commit c2de422c87
2 changed files with 13 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: union_vnops.c,v 1.37 2010/07/01 13:00:56 hannken Exp $ */
/* $NetBSD: union_vnops.c,v 1.38 2010/07/02 07:56:46 hannken Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.37 2010/07/01 13:00:56 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.38 2010/07/02 07:56:46 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1630,7 +1630,6 @@ union_lock(void *v)
flags = (flags & ~LK_SHARED) | LK_EXCLUSIVE;
}
genfs_nolock(ap);
/*
* Need to do real lockmgr-style locking here.
* in the mean time, draining won't work quite right,
@ -1640,7 +1639,6 @@ union_lock(void *v)
if ((flags & LK_TYPE_MASK) == LK_DRAIN)
return (0);
*/
flags &= ~LK_INTERLOCK;
un = VTOUNION(vp);
start:
@ -1734,7 +1732,6 @@ union_unlock(void *v)
#ifdef DIAGNOSTIC
un->un_pid = 0;
#endif
genfs_nounlock(ap);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dead_vnops.c,v 1.48 2009/03/14 21:04:24 dsl Exp $ */
/* $NetBSD: dead_vnops.c,v 1.49 2010/07/02 07:58:09 hannken Exp $ */
/*
* Copyright (c) 1989, 1993
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.48 2009/03/14 21:04:24 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: dead_vnops.c,v 1.49 2010/07/02 07:58:09 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -70,7 +70,7 @@ int dead_print(void *);
int dead_getpages(void *);
#define dead_putpages genfs_null_putpages
int chkvnlock(struct vnode *, bool);
int chkvnlock(struct vnode *);
int dead_default_error(void *);
int (**dead_vnodeop_p)(void *);
@ -135,7 +135,7 @@ dead_read(void *v)
kauth_cred_t a_cred;
} */ *ap = v;
if (chkvnlock(ap->a_vp, false))
if (chkvnlock(ap->a_vp))
panic("dead_read: lock");
/*
* Return EOF for tty devices, EIO for others
@ -159,7 +159,7 @@ dead_write(void *v)
kauth_cred_t a_cred;
} */ *ap = v;
if (chkvnlock(ap->a_vp, false))
if (chkvnlock(ap->a_vp))
panic("dead_write: lock");
return (EIO);
}
@ -180,7 +180,7 @@ dead_ioctl(void *v)
struct lwp *a_l;
} */ *ap = v;
if (!chkvnlock(ap->a_vp, false))
if (!chkvnlock(ap->a_vp))
return (EBADF);
return (VCALL(ap->a_vp, VOFFSET(vop_ioctl), ap));
}
@ -213,7 +213,7 @@ dead_strategy(void *v)
struct buf *a_bp;
} */ *ap = v;
struct buf *bp;
if (ap->a_vp == NULL || !chkvnlock(ap->a_vp, false)) {
if (ap->a_vp == NULL || !chkvnlock(ap->a_vp)) {
bp = ap->a_bp;
bp->b_error = EIO;
bp->b_resid = bp->b_bcount;
@ -234,14 +234,8 @@ dead_lock(void *v)
int a_flags;
struct proc *a_p;
} */ *ap = v;
bool interlock;
if (ap->a_flags & LK_INTERLOCK) {
interlock = true;
ap->a_flags &= ~LK_INTERLOCK;
} else
interlock = false;
if (!chkvnlock(ap->a_vp, interlock))
if (!chkvnlock(ap->a_vp))
return (0);
return (VCALL(ap->a_vp, VOFFSET(vop_lock), ap));
}
@ -260,7 +254,7 @@ dead_bmap(void *v)
int *a_runp;
} */ *ap = v;
if (!chkvnlock(ap->a_vp, false))
if (!chkvnlock(ap->a_vp))
return (EIO);
return (VOP_BMAP(ap->a_vp, ap->a_bn, ap->a_vpp, ap->a_bnp, ap->a_runp));
}
@ -301,12 +295,11 @@ dead_getpages(void *v)
* in a state of change.
*/
int
chkvnlock(struct vnode *vp, bool interlock)
chkvnlock(struct vnode *vp)
{
int locked = 0;
if (!interlock)
mutex_enter(&vp->v_interlock);
mutex_enter(&vp->v_interlock);
while (vp->v_iflag & VI_XLOCK) {
vwait(vp, VI_XLOCK);
locked = 1;