vfio/mdev: Remove duplicate storage of parent in mdev_device
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 6 Apr 2021 19:40:33 +0000 (16:40 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 7 Apr 2021 21:39:18 +0000 (15:39 -0600)
commitfbea43239074e16c91048f5ce70378664efbdb99
tree7f5e3283f9fb4716fc3f0461229d752cbdba2b1c
parent18d731242d5c67c0783126c42d3f85870cec2df5
vfio/mdev: Remove duplicate storage of parent in mdev_device

mdev_device->type->parent is the same thing.

The struct mdev_device was relying on the kref on the mdev_parent to also
indirectly hold a kref on the mdev_type pointer. Now that the type holds a
kref on the parent we can directly kref the mdev_type and remove this
implicit relationship.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <10-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/mdev/mdev_core.c
drivers/vfio/mdev/vfio_mdev.c
include/linux/mdev.h