cache_io() did not set the state of a page to PAGE_STATE_MODIFIED when it wrote

to it - if that page was read from disk unmodified before (or written back in
the mean time), the updated contents coult not be detected, and therefore, were
never written back.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14048 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-08-22 20:31:32 +00:00
parent 9276c86365
commit 4784eca19d
1 changed files with 7 additions and 3 deletions

View File

@ -784,9 +784,13 @@ cache_io(void *_cacheRef, off_t offset, addr_t buffer, size_t *_size, bool doWri
}
// and copy the contents of the page already in memory
if (doWrite)
if (doWrite) {
user_memcpy((void *)(virtualAddress + pageOffset), (void *)buffer, bytesInPage);
else
// make sure the page is in the modified list
if (page->state != PAGE_STATE_MODIFIED)
vm_page_set_state(page, PAGE_STATE_MODIFIED);
} else
user_memcpy((void *)buffer, (void *)(virtualAddress + pageOffset), bytesInPage);
vm_put_physical_page(virtualAddress);
@ -1001,7 +1005,7 @@ file_cache_init_post_boot_device(void)
// ToDo: get cache module out of driver settings
if (get_module("file_cache/launch_speedup/v1", (module_info **)&sCacheModule) == B_OK) {
dprintf("** opened launch speedup\n");
dprintf("** opened launch speedup: %Ld\n", system_time());
} else
dprintf("** could not open launch speedup!\n");