PutVNode(): Switch order of put_vnode() and _DecrementVNodeCount(). After the

put_vnode() might be removed from our map, if that was the last reference to
the node, so _DecrementVNodeCount() would emit an error message -- harmless
but annoying. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29586 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-03-18 13:12:34 +00:00
parent 81824f60e5
commit 557f6a25da
1 changed files with 7 additions and 4 deletions

View File

@ -312,10 +312,13 @@ status_t
Volume::PutVNode(ino_t vnid) Volume::PutVNode(ino_t vnid)
{ {
PRINT(("put_vnode(%ld, %lld)\n", GetID(), vnid)); PRINT(("put_vnode(%ld, %lld)\n", GetID(), vnid));
status_t error = put_vnode(fFSVolume, vnid); // Decrement the count first. We might not have another chance, since
if (error == B_OK) // put_vnode() could put the last reference, thus causing the node to be
_DecrementVNodeCount(vnid); // removed from our map. This is all not very dramatic, but this way we
return error; // avoid an erroneous error message from _DecrementVNodeCount().
_DecrementVNodeCount(vnid);
return put_vnode(fFSVolume, vnid);
} }