vfs_get_vnode_cache() now only allocates a new cache if requested: this

prevents the system to allocate caches for files that don't use or have
a file cache (ie. only those can be mmap()ed!).
Therefore, cache_prefetch() no longer crashes when trying to prefetch
files without a file cache.
read_into_cache() no longer does anything if the requested size is 0.
Fixed a bug in cache_prefetch_vnode(): if the cache couldn't be retrieved,
it put the vnode, but didn't own it (the caller does).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13904 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-08-05 11:52:22 +00:00
parent 06ae92cd04
commit eab435cd59
4 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -1099,7 +1099,7 @@ _vm_map_file(aspace_id aid, const char *name, void **_address, uint32 addressSpe
if (status < B_OK)
goto err1;
status = vfs_get_vnode_cache(vnode, &cacheRef);
status = vfs_get_vnode_cache(vnode, &cacheRef, false);
if (status < B_OK)
goto err2;