Although probably not used ATM, cache_prefetch_vnode() should respect

busy pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21815 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-08-04 00:24:13 +00:00
parent 1820113ead
commit 7c3a45ec5e

View File

@ -1112,6 +1112,15 @@ cache_prefetch_vnode(void *vnode, off_t offset, size_t size)
restart:
vm_page *page = vm_cache_lookup_page(cache, offset);
if (page != NULL) {
if (page->state == PAGE_STATE_BUSY) {
// if busy retry again a little later
mutex_unlock(&cache->lock);
snooze(20000);
mutex_lock(&cache->lock);
goto restart;
}
// it is, so let's satisfy in the first part of the request
if (lastOffset < offset) {
size_t requestSize = offset - lastOffset;