Lines Matching refs:elm
229 struct iopt_pages_list *elm; in iopt_alloc_area_pages() local
233 list_for_each_entry(elm, pages_list, next) { in iopt_alloc_area_pages()
234 elm->area = kzalloc(sizeof(*elm->area), GFP_KERNEL_ACCOUNT); in iopt_alloc_area_pages()
235 if (!elm->area) in iopt_alloc_area_pages()
247 elm = list_first_entry(pages_list, struct iopt_pages_list, in iopt_alloc_area_pages()
251 (uintptr_t)elm->pages->uptr + elm->start_byte, length); in iopt_alloc_area_pages()
270 list_for_each_entry(elm, pages_list, next) { in iopt_alloc_area_pages()
271 rc = iopt_insert_area(iopt, elm->area, elm->pages, iova, in iopt_alloc_area_pages()
272 elm->start_byte, elm->length, iommu_prot); in iopt_alloc_area_pages()
275 iova += elm->length; in iopt_alloc_area_pages()
297 struct iopt_pages_list *elm; in iopt_free_pages_list() local
299 while ((elm = list_first_entry_or_null(pages_list, in iopt_free_pages_list()
301 if (elm->area) in iopt_free_pages_list()
302 iopt_abort_area(elm->area); in iopt_free_pages_list()
303 if (elm->pages) in iopt_free_pages_list()
304 iopt_put_pages(elm->pages); in iopt_free_pages_list()
305 list_del(&elm->next); in iopt_free_pages_list()
306 kfree(elm); in iopt_free_pages_list()
313 struct iopt_pages_list *elm; in iopt_fill_domains_pages() local
316 list_for_each_entry(elm, pages_list, next) { in iopt_fill_domains_pages()
317 rc = iopt_area_fill_domains(elm->area, elm->pages); in iopt_fill_domains_pages()
325 if (undo_elm == elm) in iopt_fill_domains_pages()
336 struct iopt_pages_list *elm; in iopt_map_pages() local
350 list_for_each_entry(elm, pages_list, next) { in iopt_map_pages()
356 elm->area->pages = elm->pages; in iopt_map_pages()
357 elm->pages = NULL; in iopt_map_pages()
358 elm->area = NULL; in iopt_map_pages()
390 struct iopt_pages_list elm = {}; in iopt_map_user_pages() local
394 elm.pages = iopt_alloc_pages(uptr, length, iommu_prot & IOMMU_WRITE); in iopt_map_user_pages()
395 if (IS_ERR(elm.pages)) in iopt_map_user_pages()
396 return PTR_ERR(elm.pages); in iopt_map_user_pages()
398 elm.pages->account_mode == IOPT_PAGES_ACCOUNT_USER) in iopt_map_user_pages()
399 elm.pages->account_mode = IOPT_PAGES_ACCOUNT_MM; in iopt_map_user_pages()
400 elm.start_byte = uptr - elm.pages->uptr; in iopt_map_user_pages()
401 elm.length = length; in iopt_map_user_pages()
402 list_add(&elm.next, &pages_list); in iopt_map_user_pages()
406 if (elm.area) in iopt_map_user_pages()
407 iopt_abort_area(elm.area); in iopt_map_user_pages()
408 if (elm.pages) in iopt_map_user_pages()
409 iopt_put_pages(elm.pages); in iopt_map_user_pages()
430 struct iopt_pages_list *elm; in iopt_get_pages() local
433 elm = kzalloc(sizeof(*elm), GFP_KERNEL_ACCOUNT); in iopt_get_pages()
434 if (!elm) { in iopt_get_pages()
438 elm->start_byte = iopt_area_start_byte(area, iter.cur_iova); in iopt_get_pages()
439 elm->pages = area->pages; in iopt_get_pages()
440 elm->length = (last - iter.cur_iova) + 1; in iopt_get_pages()
441 kref_get(&elm->pages->kref); in iopt_get_pages()
442 list_add_tail(&elm->next, pages_list); in iopt_get_pages()