Lines Matching full:elm

249 	struct iopt_pages_list *elm;  in iopt_alloc_area_pages()  local
253 list_for_each_entry(elm, pages_list, next) { in iopt_alloc_area_pages()
254 elm->area = iopt_area_alloc(); in iopt_alloc_area_pages()
255 if (!elm->area) in iopt_alloc_area_pages()
267 elm = list_first_entry(pages_list, struct iopt_pages_list, in iopt_alloc_area_pages()
271 (uintptr_t)elm->pages->uptr + elm->start_byte, length); in iopt_alloc_area_pages()
290 list_for_each_entry(elm, pages_list, next) { in iopt_alloc_area_pages()
291 rc = iopt_insert_area(iopt, elm->area, elm->pages, iova, in iopt_alloc_area_pages()
292 elm->start_byte, elm->length, iommu_prot); in iopt_alloc_area_pages()
295 iova += elm->length; in iopt_alloc_area_pages()
317 struct iopt_pages_list *elm; in iopt_free_pages_list() local
319 while ((elm = list_first_entry_or_null(pages_list, in iopt_free_pages_list()
321 if (elm->area) in iopt_free_pages_list()
322 iopt_abort_area(elm->area); in iopt_free_pages_list()
323 if (elm->pages) in iopt_free_pages_list()
324 iopt_put_pages(elm->pages); in iopt_free_pages_list()
325 list_del(&elm->next); in iopt_free_pages_list()
326 kfree(elm); in iopt_free_pages_list()
333 struct iopt_pages_list *elm; in iopt_fill_domains_pages() local
336 list_for_each_entry(elm, pages_list, next) { in iopt_fill_domains_pages()
337 rc = iopt_area_fill_domains(elm->area, elm->pages); in iopt_fill_domains_pages()
345 if (undo_elm == elm) in iopt_fill_domains_pages()
356 struct iopt_pages_list *elm; in iopt_map_pages() local
370 list_for_each_entry(elm, pages_list, next) { in iopt_map_pages()
376 elm->area->pages = elm->pages; in iopt_map_pages()
377 elm->pages = NULL; in iopt_map_pages()
378 elm->area = NULL; in iopt_map_pages()
410 struct iopt_pages_list elm = {}; in iopt_map_user_pages() local
414 elm.pages = iopt_alloc_pages(uptr, length, iommu_prot & IOMMU_WRITE); in iopt_map_user_pages()
415 if (IS_ERR(elm.pages)) in iopt_map_user_pages()
416 return PTR_ERR(elm.pages); in iopt_map_user_pages()
418 elm.pages->account_mode == IOPT_PAGES_ACCOUNT_USER) in iopt_map_user_pages()
419 elm.pages->account_mode = IOPT_PAGES_ACCOUNT_MM; in iopt_map_user_pages()
420 elm.start_byte = uptr - elm.pages->uptr; in iopt_map_user_pages()
421 elm.length = length; in iopt_map_user_pages()
422 list_add(&elm.next, &pages_list); in iopt_map_user_pages()
426 if (elm.area) in iopt_map_user_pages()
427 iopt_abort_area(elm.area); in iopt_map_user_pages()
428 if (elm.pages) in iopt_map_user_pages()
429 iopt_put_pages(elm.pages); in iopt_map_user_pages()
450 struct iopt_pages_list *elm; in iopt_get_pages() local
453 elm = kzalloc(sizeof(*elm), GFP_KERNEL_ACCOUNT); in iopt_get_pages()
454 if (!elm) { in iopt_get_pages()
458 elm->start_byte = iopt_area_start_byte(area, iter.cur_iova); in iopt_get_pages()
459 elm->pages = area->pages; in iopt_get_pages()
460 elm->length = (last - iter.cur_iova) + 1; in iopt_get_pages()
461 kref_get(&elm->pages->kref); in iopt_get_pages()
462 list_add_tail(&elm->next, pages_list); in iopt_get_pages()