summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-02-26 02:36:40 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-02-26 02:36:40 +0000
commit3004f07ff1ea03f40f52310a0958a88a4d687e66 (patch)
treee86682d155f599ed802ce8cf210979fd471ca067 /sys/kern/vfs_subr.c
parentfda7deb44b18675f5806aed9b44d7b7af0a24ddc (diff)
Move v_writecount test back to it original place
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index c1702e63ab4..ba78231d3ea 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.52 2001/02/26 00:18:33 csapuntz Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.53 2001/02/26 02:36:39 csapuntz Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -768,9 +768,9 @@ vput(vp)
simple_lock(&vp->v_interlock);
#ifdef DIAGNOSTIC
- if (vp->v_usecount == 0 || vp->v_writecount != 0) {
- vprint("vput: bad ref count", vp);
- panic("vput: ref cnt");
+ if (vp->v_usecount == 0) {
+ vprint("vrele: bad ref count", vp);
+ panic("vrele: ref cnt");
}
#endif
vp->v_usecount--;
@@ -779,7 +779,13 @@ vput(vp)
VOP_UNLOCK(vp, 0, p);
return;
}
-
+
+#ifdef DIAGNOSTIC
+ if (vp->v_writecount != 0) {
+ vprint("vrele: bad writecount", vp);
+ panic("vrele: v_writecount != 0");
+ }
+#endif
vputonfreelist(vp);
simple_unlock(&vp->v_interlock);
@@ -803,7 +809,7 @@ vrele(vp)
#endif
simple_lock(&vp->v_interlock);
#ifdef DIAGNOSTIC
- if (vp->v_usecount == 0 || vp->v_writecount != 0) {
+ if (vp->v_usecount == 0) {
vprint("vrele: bad ref count", vp);
panic("vrele: ref cnt");
}
@@ -814,6 +820,12 @@ vrele(vp)
return;
}
+#ifdef DIAGNOSTIC
+ if (vp->v_writecount != 0) {
+ vprint("vrele: bad writecount", vp);
+ panic("vrele: v_writecount != 0");
+ }
+#endif
vputonfreelist(vp);
if (vn_lock(vp, LK_EXCLUSIVE|LK_INTERLOCK, p) == 0)