Lines Matching refs:dev_set
64 struct vfio_device_set *dev_set; in vfio_assign_device_set() local
73 dev_set = xa_load(&vfio_device_set_xa, idx); in vfio_assign_device_set()
74 if (dev_set) in vfio_assign_device_set()
86 dev_set = __xa_cmpxchg(&vfio_device_set_xa, idx, NULL, new_dev_set, in vfio_assign_device_set()
88 if (!dev_set) { in vfio_assign_device_set()
89 dev_set = new_dev_set; in vfio_assign_device_set()
94 if (xa_is_err(dev_set)) { in vfio_assign_device_set()
96 return xa_err(dev_set); in vfio_assign_device_set()
100 dev_set->device_count++; in vfio_assign_device_set()
102 mutex_lock(&dev_set->lock); in vfio_assign_device_set()
103 device->dev_set = dev_set; in vfio_assign_device_set()
104 list_add_tail(&device->dev_set_list, &dev_set->device_list); in vfio_assign_device_set()
105 mutex_unlock(&dev_set->lock); in vfio_assign_device_set()
112 struct vfio_device_set *dev_set = device->dev_set; in vfio_release_device_set() local
114 if (!dev_set) in vfio_release_device_set()
117 mutex_lock(&dev_set->lock); in vfio_release_device_set()
119 mutex_unlock(&dev_set->lock); in vfio_release_device_set()
122 if (!--dev_set->device_count) { in vfio_release_device_set()
124 (unsigned long)dev_set->set_id); in vfio_release_device_set()
125 mutex_destroy(&dev_set->lock); in vfio_release_device_set()
126 kfree(dev_set); in vfio_release_device_set()
131 unsigned int vfio_device_set_open_count(struct vfio_device_set *dev_set) in vfio_device_set_open_count() argument
136 lockdep_assert_held(&dev_set->lock); in vfio_device_set_open_count()
138 list_for_each_entry(cur, &dev_set->device_list, dev_set_list) in vfio_device_set_open_count()
267 if (!device->dev_set) in __vfio_register_dev()
358 lockdep_assert_held(&device->dev_set->lock); in _vfio_device_get_kvm_safe()
383 lockdep_assert_held(&device->dev_set->lock); in vfio_device_put_kvm()
411 lockdep_assert_held(&device->dev_set->lock); in vfio_device_first_open()
443 lockdep_assert_held(&device->dev_set->lock); in vfio_device_last_close()
458 lockdep_assert_held(&device->dev_set->lock); in vfio_device_open()
473 lockdep_assert_held(&device->dev_set->lock); in vfio_device_close()