summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/vfio.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2022-09-29 16:59:24 +0200
committerAlex Williamson <alex.williamson@redhat.com>2022-10-04 20:06:58 +0200
commit912b74d26c7df2da1e261f3dac8942c8cbb76a49 (patch)
treedc28df6504b695955339e6ab871c79ffea8e4ca1 /drivers/vfio/vfio.h
parentvfio/mdev: add mdev available instance checking to the core (diff)
downloadlinux-912b74d26c7df2da1e261f3dac8942c8cbb76a49.tar.xz
linux-912b74d26c7df2da1e261f3dac8942c8cbb76a49.zip
vfio: Remove the vfio_group->users and users_comp
Kevin points out that the users is really just tracking if group->opened_file is set, so we can simplify this code to a wait_queue that looks for !opened_file under the group_rwsem. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/1-v1-917e3647f123+b1a-vfio_group_users_jgg@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/vfio.h')
-rw-r--r--drivers/vfio/vfio.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h
index 039e3208d286..78b362a92501 100644
--- a/drivers/vfio/vfio.h
+++ b/drivers/vfio/vfio.h
@@ -48,8 +48,6 @@ struct vfio_group {
* reaches 0 then the iommu_group is invalid.
*/
refcount_t drivers;
- refcount_t users;
- struct completion users_comp;
unsigned int container_users;
struct iommu_group *iommu_group;
struct vfio_container *container;
@@ -61,6 +59,7 @@ struct vfio_group {
struct rw_semaphore group_rwsem;
struct kvm *kvm;
struct file *opened_file;
+ struct swait_queue_head opened_file_wait;
struct blocking_notifier_head notifier;
};