diff options
author | tegge <tegge@FreeBSD.org> | 1998-03-14 02:55:01 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 1998-03-14 02:55:01 +0000 |
commit | fca0f926304dc460738db155c1313999fbf0545e (patch) | |
tree | 4fee79770e33532134391bb319358b225c0f7156 /sys/kern/vfs_subr.c | |
parent | 0c69f93071021cd59b52f1d6f6a77f5e3a9f6279 (diff) | |
download | FreeBSD-src-fca0f926304dc460738db155c1313999fbf0545e.zip FreeBSD-src-fca0f926304dc460738db155c1313999fbf0545e.tar.gz |
Don't misuse vnode interlocks in routines that can be called from interrupts.
PR: 5893
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 972604d..26d9cdf 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 - * $Id: vfs_subr.c,v 1.137 1998/03/07 21:35:35 dyson Exp $ + * $Id: vfs_subr.c,v 1.138 1998/03/08 09:57:15 julian Exp $ */ /* @@ -1227,12 +1227,13 @@ void vhold(vp) register struct vnode *vp; { + int s; - simple_lock(&vp->v_interlock); + s = splbio(); vp->v_holdcnt++; if (VSHOULDBUSY(vp)) vbusy(vp); - simple_unlock(&vp->v_interlock); + splx(s); } /* @@ -1242,14 +1243,15 @@ void vdrop(vp) register struct vnode *vp; { + int s; - simple_lock(&vp->v_interlock); + s = splbio(); if (vp->v_holdcnt <= 0) panic("vdrop: holdcnt"); vp->v_holdcnt--; if (VSHOULDFREE(vp)) vfree(vp); - simple_unlock(&vp->v_interlock); + splx(s); } /* |