Lines Matching defs:vmap
479 struct vm_area_struct *vmap;
481 vmap = linux_cdev_handle_find(vm_obj->handle);
483 MPASS(vmap != NULL);
484 MPASS(vmap->vm_private_data == vm_obj->handle);
486 if (likely(vmap->vm_ops != NULL && offset < vmap->vm_len)) {
487 vm_paddr_t paddr = IDX_TO_OFF(vmap->vm_pfn) + offset;
521 struct vm_area_struct *vmap;
525 vmap = linux_cdev_handle_find(vm_obj->handle);
526 MPASS(vmap != NULL);
527 MPASS(vmap->vm_private_data == vm_obj->handle);
533 down_write(&vmap->vm_mm->mmap_sem);
534 if (unlikely(vmap->vm_ops == NULL)) {
544 vmf.vma = vmap;
546 vmap->vm_pfn_count = 0;
547 vmap->vm_pfn_pcount = &vmap->vm_pfn_count;
548 vmap->vm_obj = vm_obj;
550 err = vmap->vm_ops->fault(vmap, &vmf);
552 while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) {
554 err = vmap->vm_ops->fault(vmap, &vmf);
573 *first = vmap->vm_pfn_first;
574 *last = *first + vmap->vm_pfn_count - 1;
581 up_write(&vmap->vm_mm->mmap_sem);
591 linux_cdev_handle_free(struct vm_area_struct *vmap)
594 if (vmap->vm_file != NULL)
595 fput(vmap->vm_file);
598 mmput(vmap->vm_mm);
600 kfree(vmap);
604 linux_cdev_handle_remove(struct vm_area_struct *vmap)
607 TAILQ_REMOVE(&linux_vma_head, vmap, vm_entry);
614 struct vm_area_struct *vmap;
617 TAILQ_FOREACH(vmap, &linux_vma_head, vm_entry) {
618 if (vmap->vm_private_data == handle)
622 return (vmap);
639 struct vm_area_struct *vmap;
641 vmap = linux_cdev_handle_find(handle);
642 MPASS(vmap != NULL);
648 linux_cdev_handle_remove(vmap);
650 down_write(&vmap->vm_mm->mmap_sem);
651 vm_ops = vmap->vm_ops;
653 vm_ops->close(vmap);
654 up_write(&vmap->vm_mm->mmap_sem);
656 linux_cdev_handle_free(vmap);
1232 struct vm_area_struct *vmap;
1251 * available as long as the vmap is in the linux_vma_head.
1258 vmap = kzalloc(sizeof(*vmap), GFP_KERNEL);
1259 vmap->vm_start = 0;
1260 vmap->vm_end = size;
1261 vmap->vm_pgoff = *offset / PAGE_SIZE;
1262 vmap->vm_pfn = 0;
1263 vmap->vm_flags = vmap->vm_page_prot = (nprot & VM_PROT_ALL);
1265 vmap->vm_flags |= VM_SHARED;
1266 vmap->vm_ops = NULL;
1267 vmap->vm_file = get_file(filp);
1268 vmap->vm_mm = mm;
1270 if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) {
1273 error = -OPW(fp, td, fop->mmap(filp, vmap));
1275 up_write(&vmap->vm_mm->mmap_sem);
1279 linux_cdev_handle_free(vmap);
1283 attr = pgprot2cachemode(vmap->vm_page_prot);
1285 if (vmap->vm_ops != NULL) {
1290 if (vmap->vm_ops->open == NULL ||
1291 vmap->vm_ops->close == NULL ||
1292 vmap->vm_private_data == NULL) {
1294 linux_cdev_handle_free(vmap);
1298 vm_private_data = vmap->vm_private_data;
1319 TAILQ_INSERT_TAIL(&linux_vma_head, vmap, vm_entry);
1321 vm_no_fault = (vmap->vm_ops->fault == NULL);
1327 linux_cdev_handle_free(vmap);
1348 linux_cdev_handle_remove(vmap);
1350 linux_cdev_handle_free(vmap);
1359 (vm_paddr_t)vmap->vm_pfn << PAGE_SHIFT, vmap->vm_len);
1361 *object = vm_pager_allocate(OBJT_SG, sg, vmap->vm_len,
1364 linux_cdev_handle_free(vmap);
1842 vmap(struct page **pages, unsigned int count, unsigned long flags, int prot)