MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_pager_get_pages

Function vm_pager_get_pages

freebsd/vm/vm_pager.c:295–330  ·  view source on GitHub ↗

* Page in the pages for the object using its associated pager. * The requested page must be fully valid on successful return. */

Source from the content-addressed store, hash-verified

293 * The requested page must be fully valid on successful return.
294 */
295int
296vm_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
332int
333vm_pager_get_pages_async(vm_object_t object, vm_page_t *m, int count,

Callers 4

shm_dotruncate_lockedFunction · 0.85
vm_page_grab_validFunction · 0.85
vm_fault_getpagesFunction · 0.85
vm_thread_swapinFunction · 0.85

Calls 3

vm_pager_assert_inFunction · 0.85
vm_page_lookupFunction · 0.85
vm_page_zero_invalidFunction · 0.85

Tested by

no test coverage detected