vfio: factor out a vfio_group_find_or_alloc helper
authorChristoph Hellwig <hch@lst.de>
Fri, 24 Sep 2021 15:56:54 +0000 (17:56 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 30 Sep 2021 18:46:43 +0000 (12:46 -0600)
commit1362591f15233bdc3d1fbf27e266068bd16a4e92
tree0e88ca56a5015a276893daadfa3912a3202d4e32
parentc5b4ba9730e6d607d11c3c3c9b2f04852e121423
vfio: factor out a vfio_group_find_or_alloc helper

Factor out a helper to find or allocate the vfio_group to reduce the
spagetthi code in vfio_register_group_dev a little.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20210924155705.4258-5-hch@lst.de
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c