diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2022-09-29 11:59:24 -0300 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2022-10-04 12:06:58 -0600 |
commit | 912b74d26c7df2da1e261f3dac8942c8cbb76a49 (patch) | |
tree | dc28df6504b695955339e6ab871c79ffea8e4ca1 /drivers/vfio/vfio.h | |
parent | 9c799c224d6ebc5be51065bd3217a2d7eea23b8f (diff) |
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.h | 3 |
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; }; |