Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/xen/gntdev/gntdev.c
Show First 20 Lines • Show All 600 Lines • ▼ Show 20 Lines | notify_unmap_cleanup(struct gntdev_gmap *gmap) | ||||
/* Free the pages. */ | /* Free the pages. */ | ||||
VM_OBJECT_WLOCK(gmap->map->mem); | VM_OBJECT_WLOCK(gmap->map->mem); | ||||
retry: | retry: | ||||
for (i = 0; i < gmap->count; i++) { | for (i = 0; i < gmap->count; i++) { | ||||
m = vm_page_lookup(gmap->map->mem, i); | m = vm_page_lookup(gmap->map->mem, i); | ||||
if (m == NULL) | if (m == NULL) | ||||
continue; | continue; | ||||
if (vm_page_sleep_if_busy(m, "pcmdum")) | if (vm_page_busy_acquire(m, VM_ALLOC_WAITFAIL) == 0) | ||||
goto retry; | goto retry; | ||||
cdev_pager_free_page(gmap->map->mem, m); | cdev_pager_free_page(gmap->map->mem, m); | ||||
} | } | ||||
VM_OBJECT_WUNLOCK(gmap->map->mem); | VM_OBJECT_WUNLOCK(gmap->map->mem); | ||||
/* Perform unmap hypercall. */ | /* Perform unmap hypercall. */ | ||||
error = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, | error = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, | ||||
unmap_ops, count); | unmap_ops, count); | ||||
▲ Show 20 Lines • Show All 676 Lines • Show Last 20 Lines |