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

Function dev_pager_dealloc

freebsd/vm/device_pager.c:255–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255static void
256dev_pager_dealloc(vm_object_t object)
257{
258 vm_page_t m;
259
260 VM_OBJECT_WUNLOCK(object);
261 object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev);
262
263 mtx_lock(&dev_pager_mtx);
264 TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list);
265 mtx_unlock(&dev_pager_mtx);
266 VM_OBJECT_WLOCK(object);
267
268 if (object->type == OBJT_DEVICE) {
269 /*
270 * Free up our fake pages.
271 */
272 while ((m = TAILQ_FIRST(&object->un_pager.devp.devp_pglist))
273 != NULL) {
274 if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0)
275 continue;
276
277 dev_pager_free_page(object, m);
278 }
279 }
280 object->handle = NULL;
281 object->type = OBJT_DEAD;
282}
283
284static int
285dev_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int *rbehind,

Callers

nothing calls this directly

Calls 4

vm_page_busy_acquireFunction · 0.85
dev_pager_free_pageFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected