Lines Matching full:elm

242 	struct iopt_pages_list *elm;  in iopt_alloc_area_pages()  local
246 list_for_each_entry(elm, pages_list, next) { in iopt_alloc_area_pages()
247 elm->area = iopt_area_alloc(); in iopt_alloc_area_pages()
248 if (!elm->area) in iopt_alloc_area_pages()
260 elm = list_first_entry(pages_list, struct iopt_pages_list, in iopt_alloc_area_pages()
264 (uintptr_t)elm->pages->uptr + elm->start_byte, length); in iopt_alloc_area_pages()
283 list_for_each_entry(elm, pages_list, next) { in iopt_alloc_area_pages()
284 rc = iopt_insert_area(iopt, elm->area, elm->pages, iova, in iopt_alloc_area_pages()
285 elm->start_byte, elm->length, iommu_prot); in iopt_alloc_area_pages()
288 iova += elm->length; in iopt_alloc_area_pages()
310 struct iopt_pages_list *elm; in iopt_free_pages_list() local
312 while ((elm = list_first_entry_or_null(pages_list, in iopt_free_pages_list()
314 if (elm->area) in iopt_free_pages_list()
315 iopt_abort_area(elm->area); in iopt_free_pages_list()
316 if (elm->pages) in iopt_free_pages_list()
317 iopt_put_pages(elm->pages); in iopt_free_pages_list()
318 list_del(&elm->next); in iopt_free_pages_list()
319 kfree(elm); in iopt_free_pages_list()
326 struct iopt_pages_list *elm; in iopt_fill_domains_pages() local
329 list_for_each_entry(elm, pages_list, next) { in iopt_fill_domains_pages()
330 rc = iopt_area_fill_domains(elm->area, elm->pages); in iopt_fill_domains_pages()
338 if (undo_elm == elm) in iopt_fill_domains_pages()
349 struct iopt_pages_list *elm; in iopt_map_pages() local
363 list_for_each_entry(elm, pages_list, next) { in iopt_map_pages()
369 elm->area->pages = elm->pages; in iopt_map_pages()
370 elm->pages = NULL; in iopt_map_pages()
371 elm->area = NULL; in iopt_map_pages()
403 struct iopt_pages_list elm = {}; in iopt_map_user_pages() local
407 elm.pages = iopt_alloc_pages(uptr, length, iommu_prot & IOMMU_WRITE); in iopt_map_user_pages()
408 if (IS_ERR(elm.pages)) in iopt_map_user_pages()
409 return PTR_ERR(elm.pages); in iopt_map_user_pages()
411 elm.pages->account_mode == IOPT_PAGES_ACCOUNT_USER) in iopt_map_user_pages()
412 elm.pages->account_mode = IOPT_PAGES_ACCOUNT_MM; in iopt_map_user_pages()
413 elm.start_byte = uptr - elm.pages->uptr; in iopt_map_user_pages()
414 elm.length = length; in iopt_map_user_pages()
415 list_add(&elm.next, &pages_list); in iopt_map_user_pages()
419 if (elm.area) in iopt_map_user_pages()
420 iopt_abort_area(elm.area); in iopt_map_user_pages()
421 if (elm.pages) in iopt_map_user_pages()
422 iopt_put_pages(elm.pages); in iopt_map_user_pages()
614 struct iopt_pages_list *elm; in iopt_get_pages() local
617 elm = kzalloc(sizeof(*elm), GFP_KERNEL_ACCOUNT); in iopt_get_pages()
618 if (!elm) { in iopt_get_pages()
622 elm->start_byte = iopt_area_start_byte(area, iter.cur_iova); in iopt_get_pages()
623 elm->pages = area->pages; in iopt_get_pages()
624 elm->length = (last - iter.cur_iova) + 1; in iopt_get_pages()
625 kref_get(&elm->pages->kref); in iopt_get_pages()
626 list_add_tail(&elm->next, pages_list); in iopt_get_pages()