From 0254f09df28c131c21f24116b74477cdf5f9de3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 5 Mar 2006 20:54:17 +0000 Subject: [PATCH] It's not so problematic if a busy vnode was released; what is problematic is if that was the last ref. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16590 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index b9b8bc6f3e..93827d4f4a 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -695,18 +695,16 @@ free_vnode(struct vnode *vnode, bool reenter) static status_t dec_vnode_ref_count(struct vnode *vnode, bool reenter) { - int32 oldRefCount; - mutex_lock(&sVnodeMutex); - if (vnode->busy) - panic("dec_vnode_ref_count called on vnode that was busy! vnode %p\n", vnode); - - oldRefCount = atomic_add(&vnode->ref_count, -1); + int32 oldRefCount = atomic_add(&vnode->ref_count, -1); TRACE(("dec_vnode_ref_count: vnode %p, ref now %ld\n", vnode, vnode->ref_count)); if (oldRefCount == 1) { + if (vnode->busy) + panic("dec_vnode_ref_count: called on busy vnode %p\n", vnode); + bool freeNode = false; // Just insert the vnode into an unused list if we don't need