* The method vm_cache_remove_consumer() and the page daemon used to get
a reference to a by them not yet referenced cache was not correct. They only incremented the reference count, but a vnode cache reference includes also a vnode reference. In case of the page daemon this would cause vnode references to be lost (causing bug #1465). * The page daemon used an unsafe method to access a yet unreferenced page cache. There was nothing that prevented the cache from being deleted while the page daemon tried to get a reference. The vm_page::cache field is now protected by the page cache table spinlock, too, which the new function vm_cache_acquire_page_cache_ref(), used by the page daemon, also acquires while trying to get the reference. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22208 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -23,6 +23,7 @@ status_t vm_cache_init(struct kernel_args *args);
|
||||
vm_cache *vm_cache_create(vm_store *store);
|
||||
void vm_cache_acquire_ref(vm_cache *cache);
|
||||
void vm_cache_release_ref(vm_cache *cache);
|
||||
vm_cache *vm_cache_acquire_page_cache_ref(vm_page *page);
|
||||
vm_page *vm_cache_lookup_page(vm_cache *cache, off_t page);
|
||||
void vm_cache_insert_page(vm_cache *cache, vm_page *page, off_t offset);
|
||||
void vm_cache_remove_page(vm_cache *cache, vm_page *page);
|
||||
|
||||
Reference in New Issue
Block a user