Ticket #2552: file_cache.diff

File file_cache.diff, 824 bytes (added by emitrax, 16 years ago)
  • src/system/kernel/cache/file_cache.cpp

     
    649649            // to manually maintain its usage_count
    650650            page->usage_count = 2;
    651651
     652            // Mark it busy as vm_page_reserve_pages might still
     653            // a page from the same cache
     654            vm_page_set_state(page, PAGE_STATE_BUSY);
     655            locker.Unlock();
     656
    652657            // and copy the contents of the page already in memory
    653658            if (doWrite) {
    654659                if (useBuffer) {
     
    667672                    (void *)(virtualAddress + pageOffset), bytesInPage);
    668673            }
    669674
     675            locker.Lock();
     676            vm_page_set_state(page, PAGE_STATE_MODIFIED);
     677
    670678            vm_put_physical_page(virtualAddress);
    671679
    672680            if (bytesLeft <= bytesInPage) {