* Fixed the strange vm_cache_ref reference count mechanism: now, a fresh

vm_cache_ref starts with a reference count of 1. When acquiring a vm_cache,
  you no longer need to worry if that should go through the vm_store, or not;
  as it now always does.
* map_backing_store() no longer needs to play with the vm_cache_ref
  references.
* that simplified some code.
* vfs_get_vnode_cache() now grabs a reference to the cache, if successful.
* better balanced vnode ownership on vnode_store creation (vnode_store
  released the vnode before if its creation failed).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15641 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-21 17:00:03 +00:00
parent d5abe15e84
commit ea2cd27e57
6 changed files with 77 additions and 76 deletions
+1
View File
@@ -947,6 +947,7 @@ cache_prefetch_vnode(void *vnode, off_t offset, size_t size)
out:
mutex_unlock(&cache->lock);
vm_cache_release_ref(cache);
}
+2 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@@ -112,10 +112,8 @@ extern "C" vm_store *
vm_create_vnode_store(void *vnode)
{
vnode_store *store = (vnode_store *)malloc(sizeof(struct vnode_store));
if (store == NULL) {
vfs_put_vnode(vnode);
if (store == NULL)
return NULL;
}
store->vm.ops = &sStoreOps;
store->vm.cache = NULL;