[PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle

Jason Gunthorpe jgg at ziepe.ca
Fri Sep 9 23:53:12 UTC 2022


On Fri, Sep 09, 2022 at 08:42:25AM +0000, Tian, Kevin wrote:

> I think it's quite common to have an alloc() helper initialize refcount, e.g.
> vfio_group_alloc() both initialize its user refcount and also call
> device_initialize()  to gets kref initialized. Similar example in
> ib_alloc_device(), etc.

Right, it is quite a good/common pattern to have an allocation function
return a refcount to the caller.

I don't know of any naming standard for this however.

Jason


More information about the dri-devel mailing list