Lines Matching refs:staccess

655 	struct selftest_access *staccess = data;  in iommufd_test_access_unmap()  local
659 mutex_lock(&staccess->lock); in iommufd_test_access_unmap()
660 list_for_each_entry_safe(item, tmp, &staccess->items, items_elm) { in iommufd_test_access_unmap()
665 iommufd_access_unpin_pages(staccess->access, item->iova, in iommufd_test_access_unmap()
669 mutex_unlock(&staccess->lock); in iommufd_test_access_unmap()
677 struct selftest_access *staccess; in iommufd_test_access_item_destroy() local
679 staccess = iommufd_access_get(access_id); in iommufd_test_access_item_destroy()
680 if (IS_ERR(staccess)) in iommufd_test_access_item_destroy()
681 return PTR_ERR(staccess); in iommufd_test_access_item_destroy()
683 mutex_lock(&staccess->lock); in iommufd_test_access_item_destroy()
684 list_for_each_entry(item, &staccess->items, items_elm) { in iommufd_test_access_item_destroy()
687 iommufd_access_unpin_pages(staccess->access, item->iova, in iommufd_test_access_item_destroy()
689 mutex_unlock(&staccess->lock); in iommufd_test_access_item_destroy()
691 fput(staccess->file); in iommufd_test_access_item_destroy()
695 mutex_unlock(&staccess->lock); in iommufd_test_access_item_destroy()
696 fput(staccess->file); in iommufd_test_access_item_destroy()
703 struct selftest_access *staccess = filep->private_data; in iommufd_test_staccess_release() local
705 if (staccess->access) { in iommufd_test_staccess_release()
706 iommufd_test_access_unmap(staccess, 0, ULONG_MAX); in iommufd_test_staccess_release()
707 iommufd_access_destroy(staccess->access); in iommufd_test_staccess_release()
709 mutex_destroy(&staccess->lock); in iommufd_test_staccess_release()
710 kfree(staccess); in iommufd_test_staccess_release()
729 struct selftest_access *staccess; in iommufd_test_alloc_access() local
732 staccess = kzalloc(sizeof(*staccess), GFP_KERNEL_ACCOUNT); in iommufd_test_alloc_access()
733 if (!staccess) in iommufd_test_alloc_access()
735 INIT_LIST_HEAD(&staccess->items); in iommufd_test_alloc_access()
736 mutex_init(&staccess->lock); in iommufd_test_alloc_access()
739 &iommfd_test_staccess_fops, staccess, in iommufd_test_alloc_access()
742 kfree(staccess); in iommufd_test_alloc_access()
745 staccess->file = filep; in iommufd_test_alloc_access()
746 return staccess; in iommufd_test_alloc_access()
753 struct selftest_access *staccess; in iommufd_test_create_access() local
762 staccess = iommufd_test_alloc_access(); in iommufd_test_create_access()
763 if (IS_ERR(staccess)) in iommufd_test_create_access()
764 return PTR_ERR(staccess); in iommufd_test_create_access()
777 staccess, &id); in iommufd_test_create_access()
790 staccess->access = access; in iommufd_test_create_access()
791 fd_install(fdno, staccess->file); in iommufd_test_create_access()
799 fput(staccess->file); in iommufd_test_create_access()
807 struct selftest_access *staccess; in iommufd_test_access_replace_ioas() local
810 staccess = iommufd_access_get(access_id); in iommufd_test_access_replace_ioas()
811 if (IS_ERR(staccess)) in iommufd_test_access_replace_ioas()
812 return PTR_ERR(staccess); in iommufd_test_access_replace_ioas()
814 rc = iommufd_access_replace(staccess->access, ioas_id); in iommufd_test_access_replace_ioas()
815 fput(staccess->file); in iommufd_test_access_replace_ioas()
848 struct selftest_access *staccess; in iommufd_test_access_pages() local
860 staccess = iommufd_access_get(access_id); in iommufd_test_access_pages()
861 if (IS_ERR(staccess)) in iommufd_test_access_pages()
862 return PTR_ERR(staccess); in iommufd_test_access_pages()
864 if (staccess->access->ops != &selftest_access_ops_pin) { in iommufd_test_access_pages()
870 iova = iommufd_test_syz_conv_iova(staccess->access, in iommufd_test_access_pages()
891 mutex_lock(&staccess->lock); in iommufd_test_access_pages()
892 rc = iommufd_access_pin_pages(staccess->access, iova, length, pages, in iommufd_test_access_pages()
914 item->id = staccess->next_id++; in iommufd_test_access_pages()
915 list_add_tail(&item->items_elm, &staccess->items); in iommufd_test_access_pages()
927 iommufd_access_unpin_pages(staccess->access, iova, length); in iommufd_test_access_pages()
929 mutex_unlock(&staccess->lock); in iommufd_test_access_pages()
932 fput(staccess->file); in iommufd_test_access_pages()
942 struct selftest_access *staccess; in iommufd_test_access_rw() local
954 staccess = iommufd_access_get(access_id); in iommufd_test_access_rw()
955 if (IS_ERR(staccess)) in iommufd_test_access_rw()
956 return PTR_ERR(staccess); in iommufd_test_access_rw()
972 iova = iommufd_test_syz_conv_iova(staccess->access, in iommufd_test_access_rw()
975 rc = iommufd_access_rw(staccess->access, iova, tmp, length, flags); in iommufd_test_access_rw()
988 fput(staccess->file); in iommufd_test_access_rw()