diff options
author | Alan Cox <alc@FreeBSD.org> | 2006-05-13 20:05:44 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2006-05-13 20:05:44 +0000 |
commit | 8f8790a76df782820bf474d4e10db351656fe13d (patch) | |
tree | d542856defd52c42899173a1f9493935be4fd76b /sys/vm/vm_fault.c | |
parent | 1e1de0e499852a09a8c818e2caeb92be723517fb (diff) | |
download | src-test2-8f8790a76df782820bf474d4e10db351656fe13d.tar.gz src-test2-8f8790a76df782820bf474d4e10db351656fe13d.zip |
Notes
Diffstat (limited to 'sys/vm/vm_fault.c')
-rw-r--r-- | sys/vm/vm_fault.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 7417fc1c420c..2484af192ab4 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1301,14 +1301,9 @@ vm_fault_additional_pages(m, rbehind, rahead, marray, reqpage) startpindex = pindex - rbehind; } - for (tpindex = pindex - 1; tpindex >= startpindex; tpindex -= 1) { - if (vm_page_lookup(object, tpindex)) { - startpindex = tpindex + 1; - break; - } - if (tpindex == 0) - break; - } + if ((rtm = TAILQ_PREV(m, pglist, listq)) != NULL && + rtm->pindex >= startpindex) + startpindex = rtm->pindex + 1; for (i = 0, tpindex = startpindex; tpindex < pindex; i++, tpindex++) { @@ -1342,15 +1337,13 @@ vm_fault_additional_pages(m, rbehind, rahead, marray, reqpage) * scan forward for the read ahead pages */ endpindex = tpindex + rahead; + if ((rtm = TAILQ_NEXT(m, listq)) != NULL && rtm->pindex < endpindex) + endpindex = rtm->pindex; if (endpindex > object->size) endpindex = object->size; for (; tpindex < endpindex; i++, tpindex++) { - if (vm_page_lookup(object, tpindex)) { - break; - } - rtm = vm_page_alloc(object, tpindex, VM_ALLOC_NORMAL); if (rtm == NULL) { break; |