Lines Matching full:mapped

16  * Main data structure for tracking mapped user pages of bitmap data.
90 * which u64 word of the bitmap is mapped, up to @mapped_total_index.
94 * The IOVA bitmap is usually located on what tracks DMA mapped ranges or
99 /* IOVA range representing the currently mapped bitmap data */
100 struct iova_bitmap_map mapped; member
105 /* u64 index that @mapped points to */
122 * Relative IOVA means relative to the bitmap::mapped base IOVA
123 * (stored in mapped::iova). All computations in this file are done using
124 * relative IOVAs and thus avoid an extra subtraction against mapped::iova.
130 unsigned long pgsize = 1 << bitmap->mapped.pgshift; in iova_bitmap_offset_to_index()
141 unsigned long pgshift = bitmap->mapped.pgshift; in iova_bitmap_index_to_offset()
147 * Returns the base IOVA of the mapped range.
163 struct iova_bitmap_map *mapped = &bitmap->mapped; in iova_bitmap_get() local
169 * @mapped_base_index is the index of the currently mapped u64 words in iova_bitmap_get()
171 * mapped. The range @mapped_base_index .. @mapped_total_index-1 is in iova_bitmap_get()
172 * mapped but capped at a maximum number of pages. in iova_bitmap_get()
191 FOLL_WRITE, mapped->pages); in iova_bitmap_get()
195 mapped->npages = (unsigned long)ret; in iova_bitmap_get()
197 mapped->iova = iova_bitmap_mapped_iova(bitmap); in iova_bitmap_get()
204 mapped->pgoff = offset_in_page(addr); in iova_bitmap_get()
215 struct iova_bitmap_map *mapped = &bitmap->mapped; in iova_bitmap_put() local
217 if (mapped->npages) { in iova_bitmap_put()
218 unpin_user_pages(mapped->pages, mapped->npages); in iova_bitmap_put()
219 mapped->npages = 0; in iova_bitmap_put()
240 struct iova_bitmap_map *mapped; in iova_bitmap_alloc() local
248 mapped = &bitmap->mapped; in iova_bitmap_alloc()
249 mapped->pgshift = __ffs(page_size); in iova_bitmap_alloc()
255 mapped->iova = iova; in iova_bitmap_alloc()
256 mapped->pages = (struct page **)__get_free_page(GFP_KERNEL); in iova_bitmap_alloc()
257 if (!mapped->pages) { in iova_bitmap_alloc()
281 struct iova_bitmap_map *mapped = &bitmap->mapped; in iova_bitmap_free() local
285 if (mapped->pages) { in iova_bitmap_free()
286 free_page((unsigned long)mapped->pages); in iova_bitmap_free()
287 mapped->pages = NULL; in iova_bitmap_free()
301 bytes = (bitmap->mapped.npages << PAGE_SHIFT) - bitmap->mapped.pgoff; in iova_bitmap_mapped_remaining()
311 * Returns the length of the mapped IOVA range.
370 * mapped bitmap user pages into IOVA ranges to process.
404 struct iova_bitmap_map *mapped = &bitmap->mapped; in iova_bitmap_set() local
405 unsigned long cur_bit = ((iova - mapped->iova) >> in iova_bitmap_set()
406 mapped->pgshift) + mapped->pgoff * BITS_PER_BYTE; in iova_bitmap_set()
407 unsigned long last_bit = (((iova + length - 1) - mapped->iova) >> in iova_bitmap_set()
408 mapped->pgshift) + mapped->pgoff * BITS_PER_BYTE; in iova_bitmap_set()
417 kaddr = kmap_local_page(mapped->pages[page_idx]); in iova_bitmap_set()