vfio: Remove vfio_group dev_counter
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 16 Aug 2022 19:13:04 +0000 (16:13 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 1 Sep 2022 21:29:11 +0000 (15:29 -0600)
commit21c13829bc3b786bc5336470df023ae54e41d230
tree53c20b0afef514261db0874fc957e04b816fe599
parent453e6c98fd2bdae0df9adbc86af8d8bf1164edd5
vfio: Remove vfio_group dev_counter

This counts the number of devices attached to a vfio_group, ie the number
of items in the group->device_list.

It is only read in vfio_pin_pages(), as some kind of protection against
limitations in type1.

However, with all the code cleanups in this area, now that
vfio_pin_pages() accepts a vfio_device directly it is redundant.  All
drivers are already calling vfio_register_emulated_iommu_dev() which
directly creates a group specifically for the device and thus it is
guaranteed that there is a singleton group.

Leave a note in the comment about this requirement and remove the logic.

Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/0-v2-d4374a7bf0c9+c4-vfio_dev_counter_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_main.c