On Wed, Oct 13, 2021 at 11:27:49AM -0300, Jason Gunthorpe wrote: > The next patch adds a struct device to the struct vfio_group, and it is > confusing/bad practice to have two krefs in the same struct. This kref is > controlling the period when the vfio_group is registered in sysfs, and > visible in the internal lookup. Switch it to a refcount_t instead. > > The refcount_dec_and_mutex_lock() is still required because we need > atomicity of the list searches and sysfs presence. > > Reviewed-by: Liu Yi L <yi.l.liu@xxxxxxxxx> > Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx> > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Looks good, Reviewed-by: Christoph Hellwig <hch@xxxxxx>