Lines Matching refs:vma

27  * @vma:	given virtual memory area
36 struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma)
44 if (vma->vm_ops && vma->vm_ops->open)
45 vma->vm_ops->open(vma);
47 if (vma->vm_file)
48 get_file(vma->vm_file);
50 memcpy(vma_copy, vma, sizeof(*vma));
62 * @vma: virtual memory region associated with the area to be released
67 void vb2_put_vma(struct vm_area_struct *vma)
69 if (!vma)
72 if (vma->vm_ops && vma->vm_ops->close)
73 vma->vm_ops->close(vma);
75 if (vma->vm_file)
76 fput(vma->vm_file);
78 kfree(vma);
100 struct vm_area_struct *vma;
109 vma = find_vma(mm, start);
111 if (vma == NULL || vma->vm_end < end)
115 int ret = follow_pfn(vma, start, &this_pfn);
128 * Memory is contigous, lock vma and return to the caller
130 *res_vma = vb2_get_vma(vma);
140 * vb2_common_vm_open() - increase refcount of the vma
141 * @vma: virtual memory region for the mapping
143 * This function adds another user to the provided vma. It expects
144 * struct vb2_vmarea_handler pointer in vma->vm_private_data.
146 static void vb2_common_vm_open(struct vm_area_struct *vma)
148 struct vb2_vmarea_handler *h = vma->vm_private_data;
150 pr_debug("%s: %p, refcount: %d, vma: %08lx-%08lx\n",
151 __func__, h, atomic_read(h->refcount), vma->vm_start,
152 vma->vm_end);
158 * vb2_common_vm_close() - decrease refcount of the vma
159 * @vma: virtual memory region for the mapping
161 * This function releases the user from the provided vma. It expects
162 * struct vb2_vmarea_handler pointer in vma->vm_private_data.
164 static void vb2_common_vm_close(struct vm_area_struct *vma)
166 struct vb2_vmarea_handler *h = vma->vm_private_data;
168 pr_debug("%s: %p, refcount: %d, vma: %08lx-%08lx\n",
169 __func__, h, atomic_read(h->refcount), vma->vm_start,
170 vma->vm_end);