diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2022-05-11 13:12:59 -0600 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2022-05-11 13:12:59 -0600 |
commit | c6250ffbacc5989a5db3b9acce34b93570938f60 (patch) | |
tree | 719108793f9390bf29c82e6da0f16e94b8b78edd /include | |
parent | 8e432bb015b6c327d016b1dca509964e189c4770 (diff) | |
download | linux-c6250ffbacc5989a5db3b9acce34b93570938f60.tar.gz |
vfio/mdev: Pass in a struct vfio_device * to vfio_dma_rw()
Every caller has a readily available vfio_device pointer, use that instead
of passing in a generic struct device. Change vfio_dma_rw() to take in the
struct vfio_device and move the container users that would have been held
by vfio_group_get_external_user_from_dev() to vfio_dma_rw() directly, like
vfio_pin/unpin_pages().
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/4-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/vfio.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/vfio.h b/include/linux/vfio.h index bddc70f88899..8a1510258717 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -161,7 +161,7 @@ extern int vfio_group_pin_pages(struct vfio_group *group, extern int vfio_group_unpin_pages(struct vfio_group *group, unsigned long *user_iova_pfn, int npage); -extern int vfio_dma_rw(struct vfio_group *group, dma_addr_t user_iova, +extern int vfio_dma_rw(struct vfio_device *device, dma_addr_t user_iova, void *data, size_t len, bool write); extern struct iommu_domain *vfio_group_iommu_domain(struct vfio_group *group); |