Fixed vnode interlock handling.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
            	Tor Egge <Tor.Egge@idi.ntnu.no>
This commit is contained in:
KATO Takenori 1998-02-10 02:54:24 +00:00
parent 9148904aaa
commit 1b11919b2b
2 changed files with 26 additions and 6 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
* $Id: vfs_subr.c,v 1.131 1998/02/07 08:44:31 kato Exp $
* $Id: vfs_subr.c,v 1.132 1998/02/09 06:09:35 eivind Exp $
*/
/*
@ -919,8 +919,16 @@ vget(vp, flags, p)
(vp->v_type == VREG) &&
((vp->v_object == NULL) ||
(vp->v_object->flags & OBJ_DEAD))) {
vfs_object_create(vp, curproc, curproc->p_ucred,
VOP_ISLOCKED(vp));
/*
* XXX
* When the object is locked with shared lock, VOP_ISLOCKED()
* returns true.
*/
if (VOP_ISLOCKED(vp)) {
simple_unlock(&vp->v_interlock);
vfs_object_create(vp, curproc, curproc->p_ucred, 1);
} else
vfs_object_create(vp, curproc, curproc->p_ucred, 0);
simple_lock(&vp->v_interlock);
}
if (flags & LK_TYPE_MASK) {
@ -2137,6 +2145,8 @@ vfs_object_create(vp, p, cred, waslocked)
int error = 0;
if ((vp->v_type != VREG) && (vp->v_type != VBLK)) {
if (!waslocked)
simple_unlock(&vp->v_interlock);
return 0;
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
* $Id: vfs_subr.c,v 1.131 1998/02/07 08:44:31 kato Exp $
* $Id: vfs_subr.c,v 1.132 1998/02/09 06:09:35 eivind Exp $
*/
/*
@ -919,8 +919,16 @@ vget(vp, flags, p)
(vp->v_type == VREG) &&
((vp->v_object == NULL) ||
(vp->v_object->flags & OBJ_DEAD))) {
vfs_object_create(vp, curproc, curproc->p_ucred,
VOP_ISLOCKED(vp));
/*
* XXX
* When the object is locked with shared lock, VOP_ISLOCKED()
* returns true.
*/
if (VOP_ISLOCKED(vp)) {
simple_unlock(&vp->v_interlock);
vfs_object_create(vp, curproc, curproc->p_ucred, 1);
} else
vfs_object_create(vp, curproc, curproc->p_ucred, 0);
simple_lock(&vp->v_interlock);
}
if (flags & LK_TYPE_MASK) {
@ -2137,6 +2145,8 @@ vfs_object_create(vp, p, cred, waslocked)
int error = 0;
if ((vp->v_type != VREG) && (vp->v_type != VBLK)) {
if (!waslocked)
simple_unlock(&vp->v_interlock);
return 0;
}