Lines Matching refs:dev_set
70 struct vfio_device_set *dev_set; in vfio_assign_device_set() local
79 dev_set = xa_load(&vfio_device_set_xa, idx); in vfio_assign_device_set()
80 if (dev_set) in vfio_assign_device_set()
92 dev_set = __xa_cmpxchg(&vfio_device_set_xa, idx, NULL, new_dev_set, in vfio_assign_device_set()
94 if (!dev_set) { in vfio_assign_device_set()
95 dev_set = new_dev_set; in vfio_assign_device_set()
100 if (xa_is_err(dev_set)) { in vfio_assign_device_set()
102 return xa_err(dev_set); in vfio_assign_device_set()
106 dev_set->device_count++; in vfio_assign_device_set()
108 mutex_lock(&dev_set->lock); in vfio_assign_device_set()
109 device->dev_set = dev_set; in vfio_assign_device_set()
110 list_add_tail(&device->dev_set_list, &dev_set->device_list); in vfio_assign_device_set()
111 mutex_unlock(&dev_set->lock); in vfio_assign_device_set()
118 struct vfio_device_set *dev_set = device->dev_set; in vfio_release_device_set() local
120 if (!dev_set) in vfio_release_device_set()
123 mutex_lock(&dev_set->lock); in vfio_release_device_set()
125 mutex_unlock(&dev_set->lock); in vfio_release_device_set()
128 if (!--dev_set->device_count) { in vfio_release_device_set()
130 (unsigned long)dev_set->set_id); in vfio_release_device_set()
131 mutex_destroy(&dev_set->lock); in vfio_release_device_set()
132 kfree(dev_set); in vfio_release_device_set()
137 unsigned int vfio_device_set_open_count(struct vfio_device_set *dev_set) in vfio_device_set_open_count() argument
142 lockdep_assert_held(&dev_set->lock); in vfio_device_set_open_count()
144 list_for_each_entry(cur, &dev_set->device_list, dev_set_list) in vfio_device_set_open_count()
151 vfio_find_device_in_devset(struct vfio_device_set *dev_set, in vfio_find_device_in_devset() argument
156 lockdep_assert_held(&dev_set->lock); in vfio_find_device_in_devset()
158 list_for_each_entry(cur, &dev_set->device_list, dev_set_list) in vfio_find_device_in_devset()
328 if (!device->dev_set) in __vfio_register_dev()
439 lockdep_assert_held(&device->dev_set->lock); in vfio_device_get_kvm_safe()
467 lockdep_assert_held(&device->dev_set->lock); in vfio_device_put_kvm()
511 lockdep_assert_held(&device->dev_set->lock); in vfio_df_device_first_open()
545 lockdep_assert_held(&device->dev_set->lock); in vfio_df_device_last_close()
561 lockdep_assert_held(&device->dev_set->lock); in vfio_df_open()
584 lockdep_assert_held(&device->dev_set->lock); in vfio_df_close()