Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_glue.c
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | |||||
* page is not resident, allocate and load it using the given object's pager. | * page is not resident, allocate and load it using the given object's pager. | ||||
* Return the pinned page if successful; otherwise, return NULL. | * Return the pinned page if successful; otherwise, return NULL. | ||||
*/ | */ | ||||
static vm_page_t | static vm_page_t | ||||
vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset) | vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset) | ||||
{ | { | ||||
vm_page_t m; | vm_page_t m; | ||||
vm_pindex_t pindex; | vm_pindex_t pindex; | ||||
int rv; | |||||
VM_OBJECT_WLOCK(object); | |||||
pindex = OFF_TO_IDX(offset); | pindex = OFF_TO_IDX(offset); | ||||
m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | | VM_OBJECT_WLOCK(object); | ||||
VM_ALLOC_WIRED); | (void) vm_page_grab_valid(&m, object, pindex, | ||||
alc: There should not be a space after the cast. | |||||
if (m->valid != VM_PAGE_BITS_ALL) { | VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED); | ||||
vm_page_xbusy(m); | |||||
rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); | |||||
if (rv != VM_PAGER_OK) { | |||||
vm_page_lock(m); | |||||
vm_page_unwire(m, PQ_NONE); | |||||
vm_page_free(m); | |||||
vm_page_unlock(m); | |||||
m = NULL; | |||||
goto out; | |||||
} | |||||
vm_page_xunbusy(m); | |||||
} | |||||
out: | |||||
VM_OBJECT_WUNLOCK(object); | VM_OBJECT_WUNLOCK(object); | ||||
return (m); | return (m); | ||||
} | } | ||||
/* | /* | ||||
* Return a CPU private mapping to the page at the given offset within the | * Return a CPU private mapping to the page at the given offset within the | ||||
* given object. The page is pinned before it is mapped. | * given object. The page is pinned before it is mapped. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines |
There should not be a space after the cast.