If vm_pager_get_pages() returns VM_PAGER_OK, then there is no need to check

the page's valid bits.  The page is guaranteed to be fully valid.  (For the
record, this is documented in vm/vm_pager.h's comments.)
This commit is contained in:
alc 2009-06-06 20:13:14 +00:00
parent 7758932884
commit 569ccdf52b
2 changed files with 2 additions and 3 deletions

View File

@ -948,8 +948,7 @@ exec_map_first_page(imgp)
initial_pagein = i;
rv = vm_pager_get_pages(object, ma, initial_pagein, 0);
ma[0] = vm_page_lookup(object, 0);
if ((rv != VM_PAGER_OK) || (ma[0] == NULL) ||
(ma[0]->valid == 0)) {
if ((rv != VM_PAGER_OK) || (ma[0] == NULL)) {
if (ma[0]) {
vm_page_lock_queues();
vm_page_free(ma[0]);

View File

@ -259,7 +259,7 @@ vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset)
m = vm_page_lookup(object, pindex);
if (m == NULL)
goto out;
if (m->valid == 0 || rv != VM_PAGER_OK) {
if (rv != VM_PAGER_OK) {
vm_page_lock_queues();
vm_page_free(m);
vm_page_unlock_queues();