vfio: Do not open code the group list search in vfio_create_group()
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 15 Oct 2021 11:40:51 +0000 (08:40 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 15 Oct 2021 19:58:19 +0000 (13:58 -0600)
commit1ceabade1df78c420e30efd4d39a48ceb46487bc
tree4034f2f795d6d0fffecc047cb015847ce9bed077
parent63b150fde7a2549e8bf7cb0fca7e9cfb9cad50d7
vfio: Do not open code the group list search in vfio_create_group()

Split vfio_group_get_from_iommu() into __vfio_group_get_from_iommu() so
that vfio_create_group() can call it to consolidate this duplicated code.

Reviewed-by: Liu Yi L <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/2-v3-2fdfe4ca2cc6+18c-vfio_group_cdev_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c