summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_subr.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 94dee20..fa0a62e 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1912,32 +1912,29 @@ vrele(vp)
return;
}
-
- if (vp->v_usecount == 1) {
- v_incr_usecount(vp, -1);
- /*
- * We must call VOP_INACTIVE with the node locked. Mark
- * as VI_DOINGINACT to avoid recursion.
- */
- if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) == 0) {
- VI_LOCK(vp);
- vinactive(vp, td);
- VOP_UNLOCK(vp, 0, td);
- } else
- VI_LOCK(vp);
- if (VSHOULDFREE(vp))
- vfree(vp);
- else
- vlruvp(vp);
- VI_UNLOCK(vp);
-
- } else {
+ if (vp->v_usecount != 1) {
#ifdef DIAGNOSTIC
vprint("vrele: negative ref count", vp);
#endif
VI_UNLOCK(vp);
panic("vrele: negative ref cnt");
}
+ v_incr_usecount(vp, -1);
+ /*
+ * We must call VOP_INACTIVE with the node locked. Mark
+ * as VI_DOINGINACT to avoid recursion.
+ */
+ if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) == 0) {
+ VI_LOCK(vp);
+ vinactive(vp, td);
+ VOP_UNLOCK(vp, 0, td);
+ } else
+ VI_LOCK(vp);
+ if (VSHOULDFREE(vp))
+ vfree(vp);
+ else
+ vlruvp(vp);
+ VI_UNLOCK(vp);
}
/*
OpenPOWER on IntegriCloud