History

vfio: Remove vfio_external_group_match_file()

vfio_group_fops_open() ensures there is only ever one struct file open for any struct vfio_group at any time: /* Do we need multiple instances of the group open? Seems not. */ opened = atomic_cmpxchg(&group->opened, 0, 1); if (opened) { vfio_group_put(group); return -EBUSY; Therefor the struct file * can be used directly to search the list of VFIO groups that KVM keeps instead of using the vfio_external_group_match_file() callback to try to figure out if the passed in FD matches the list or not. Delete vfio_external_group_match_file().

Jason Gunthorpe committed 4 years ago

Commit c38ff5b1 parent 50d63b53 files · +1 −29Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/vfio.h+0−2
@@ -138,8 +138,6 @@ int vfio_mig_get_next_state(struct vfio_device *device, · 137 unmodified lines
138 */138 */
139extern struct vfio_group *vfio_group_get_external_user(struct file *filep);139extern struct vfio_group *vfio_group_get_external_user(struct file *filep);
140extern void vfio_group_put_external_user(struct vfio_group *group);140extern void vfio_group_put_external_user(struct vfio_group *group);
141extern bool vfio_external_group_match_file(struct vfio_group *group,
142 struct file *filep);
143extern struct iommu_group *vfio_file_iommu_group(struct file *file);141extern struct iommu_group *vfio_file_iommu_group(struct file *file);
144extern long vfio_external_check_extension(struct vfio_group *group,142extern long vfio_external_check_extension(struct vfio_group *group,
145 unsigned long arg);143 unsigned long arg);