Lines Matching refs:staccess

1001 	struct selftest_access *staccess = data;  in iommufd_test_access_unmap()  local
1005 mutex_lock(&staccess->lock); in iommufd_test_access_unmap()
1006 list_for_each_entry_safe(item, tmp, &staccess->items, items_elm) { in iommufd_test_access_unmap()
1011 iommufd_access_unpin_pages(staccess->access, item->iova, in iommufd_test_access_unmap()
1015 mutex_unlock(&staccess->lock); in iommufd_test_access_unmap()
1023 struct selftest_access *staccess; in iommufd_test_access_item_destroy() local
1025 staccess = iommufd_access_get(access_id); in iommufd_test_access_item_destroy()
1026 if (IS_ERR(staccess)) in iommufd_test_access_item_destroy()
1027 return PTR_ERR(staccess); in iommufd_test_access_item_destroy()
1029 mutex_lock(&staccess->lock); in iommufd_test_access_item_destroy()
1030 list_for_each_entry(item, &staccess->items, items_elm) { in iommufd_test_access_item_destroy()
1033 iommufd_access_unpin_pages(staccess->access, item->iova, in iommufd_test_access_item_destroy()
1035 mutex_unlock(&staccess->lock); in iommufd_test_access_item_destroy()
1037 fput(staccess->file); in iommufd_test_access_item_destroy()
1041 mutex_unlock(&staccess->lock); in iommufd_test_access_item_destroy()
1042 fput(staccess->file); in iommufd_test_access_item_destroy()
1049 struct selftest_access *staccess = filep->private_data; in iommufd_test_staccess_release() local
1051 if (staccess->access) { in iommufd_test_staccess_release()
1052 iommufd_test_access_unmap(staccess, 0, ULONG_MAX); in iommufd_test_staccess_release()
1053 iommufd_access_destroy(staccess->access); in iommufd_test_staccess_release()
1055 mutex_destroy(&staccess->lock); in iommufd_test_staccess_release()
1056 kfree(staccess); in iommufd_test_staccess_release()
1075 struct selftest_access *staccess; in iommufd_test_alloc_access() local
1078 staccess = kzalloc(sizeof(*staccess), GFP_KERNEL_ACCOUNT); in iommufd_test_alloc_access()
1079 if (!staccess) in iommufd_test_alloc_access()
1081 INIT_LIST_HEAD(&staccess->items); in iommufd_test_alloc_access()
1082 mutex_init(&staccess->lock); in iommufd_test_alloc_access()
1085 &iommfd_test_staccess_fops, staccess, in iommufd_test_alloc_access()
1088 kfree(staccess); in iommufd_test_alloc_access()
1091 staccess->file = filep; in iommufd_test_alloc_access()
1092 return staccess; in iommufd_test_alloc_access()
1099 struct selftest_access *staccess; in iommufd_test_create_access() local
1108 staccess = iommufd_test_alloc_access(); in iommufd_test_create_access()
1109 if (IS_ERR(staccess)) in iommufd_test_create_access()
1110 return PTR_ERR(staccess); in iommufd_test_create_access()
1123 staccess, &id); in iommufd_test_create_access()
1136 staccess->access = access; in iommufd_test_create_access()
1137 fd_install(fdno, staccess->file); in iommufd_test_create_access()
1145 fput(staccess->file); in iommufd_test_create_access()
1153 struct selftest_access *staccess; in iommufd_test_access_replace_ioas() local
1156 staccess = iommufd_access_get(access_id); in iommufd_test_access_replace_ioas()
1157 if (IS_ERR(staccess)) in iommufd_test_access_replace_ioas()
1158 return PTR_ERR(staccess); in iommufd_test_access_replace_ioas()
1160 rc = iommufd_access_replace(staccess->access, ioas_id); in iommufd_test_access_replace_ioas()
1161 fput(staccess->file); in iommufd_test_access_replace_ioas()
1194 struct selftest_access *staccess; in iommufd_test_access_pages() local
1206 staccess = iommufd_access_get(access_id); in iommufd_test_access_pages()
1207 if (IS_ERR(staccess)) in iommufd_test_access_pages()
1208 return PTR_ERR(staccess); in iommufd_test_access_pages()
1210 if (staccess->access->ops != &selftest_access_ops_pin) { in iommufd_test_access_pages()
1216 iova = iommufd_test_syz_conv_iova(staccess->access, in iommufd_test_access_pages()
1237 mutex_lock(&staccess->lock); in iommufd_test_access_pages()
1238 rc = iommufd_access_pin_pages(staccess->access, iova, length, pages, in iommufd_test_access_pages()
1260 item->id = staccess->next_id++; in iommufd_test_access_pages()
1261 list_add_tail(&item->items_elm, &staccess->items); in iommufd_test_access_pages()
1273 iommufd_access_unpin_pages(staccess->access, iova, length); in iommufd_test_access_pages()
1275 mutex_unlock(&staccess->lock); in iommufd_test_access_pages()
1278 fput(staccess->file); in iommufd_test_access_pages()
1288 struct selftest_access *staccess; in iommufd_test_access_rw() local
1300 staccess = iommufd_access_get(access_id); in iommufd_test_access_rw()
1301 if (IS_ERR(staccess)) in iommufd_test_access_rw()
1302 return PTR_ERR(staccess); in iommufd_test_access_rw()
1318 iova = iommufd_test_syz_conv_iova(staccess->access, in iommufd_test_access_rw()
1321 rc = iommufd_access_rw(staccess->access, iova, tmp, length, flags); in iommufd_test_access_rw()
1334 fput(staccess->file); in iommufd_test_access_rw()