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:
parent
1820113ead
commit
7c3a45ec5e
9
src/system/kernel/cache/file_cache.cpp
vendored
9
src/system/kernel/cache/file_cache.cpp
vendored
@ -1112,6 +1112,15 @@ cache_prefetch_vnode(void *vnode, off_t offset, size_t size)
|
|||||||
restart:
|
restart:
|
||||||
vm_page *page = vm_cache_lookup_page(cache, offset);
|
vm_page *page = vm_cache_lookup_page(cache, offset);
|
||||||
if (page != NULL) {
|
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
|
// it is, so let's satisfy in the first part of the request
|
||||||
if (lastOffset < offset) {
|
if (lastOffset < offset) {
|
||||||
size_t requestSize = offset - lastOffset;
|
size_t requestSize = offset - lastOffset;
|
||||||
|
Loading…
Reference in New Issue
Block a user