reserve_pages(): When cannibalizing pages from the own cache it didn't check

whether the pages where mapped. Was introduced already in r22731.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35532 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-02-20 12:36:49 +00:00
parent d36b9aef3e
commit 211c63df5a

View File

@ -309,9 +309,10 @@ reserve_pages(file_cache_ref* ref, vm_page_reservation* reservation,
vm_page* page;
for (VMCachePagesTree::Iterator it = cache->pages.GetIterator();
(page = it.Next()) != NULL && left > 0;) {
if (page->state != PAGE_STATE_MODIFIED && !page->modified
&& !page->busy) {
if (page->state == PAGE_STATE_CACHED && !page->busy) {
DEBUG_PAGE_ACCESS_START(page);
ASSERT(!page->IsMapped());
ASSERT(!page->modified);
cache->RemovePage(page);
vm_page_set_state(page, PAGE_STATE_FREE);
left--;