* Page in the pages for the object using its associated pager. * The requested page must be fully valid on successful return. */
| 293 | * The requested page must be fully valid on successful return. |
| 294 | */ |
| 295 | int |
| 296 | vm_pager_get_pages(vm_object_t object, vm_page_t *m, int count, int *rbehind, |
| 297 | int *rahead) |
| 298 | { |
| 299 | #ifdef INVARIANTS |
| 300 | vm_pindex_t pindex = m[0]->pindex; |
| 301 | #endif |
| 302 | int r; |
| 303 | |
| 304 | vm_pager_assert_in(object, m, count); |
| 305 | |
| 306 | r = (*pagertab[object->type]->pgo_getpages)(object, m, count, rbehind, |
| 307 | rahead); |
| 308 | if (r != VM_PAGER_OK) |
| 309 | return (r); |
| 310 | |
| 311 | for (int i = 0; i < count; i++) { |
| 312 | /* |
| 313 | * If pager has replaced a page, assert that it had |
| 314 | * updated the array. |
| 315 | */ |
| 316 | #ifdef INVARIANTS |
| 317 | VM_OBJECT_RLOCK(object); |
| 318 | KASSERT(m[i] == vm_page_lookup(object, pindex++), |
| 319 | ("%s: mismatch page %p pindex %ju", __func__, |
| 320 | m[i], (uintmax_t )pindex - 1)); |
| 321 | VM_OBJECT_RUNLOCK(object); |
| 322 | #endif |
| 323 | /* |
| 324 | * Zero out partially filled data. |
| 325 | */ |
| 326 | if (m[i]->valid != VM_PAGE_BITS_ALL) |
| 327 | vm_page_zero_invalid(m[i], TRUE); |
| 328 | } |
| 329 | return (VM_PAGER_OK); |
| 330 | } |
| 331 | |
| 332 | int |
| 333 | vm_pager_get_pages_async(vm_object_t object, vm_page_t *m, int count, |
no test coverage detected