Re: [PATCH v2 2/8] nvmet-rdma: wrap raw kref_get/put() with corresponding helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 5, 2018 at 6:43 AM, Christoph Hellwig <hch@xxxxxx> wrote:
> On Mon, Jun 04, 2018 at 03:49:16PM -0600, Jason Gunthorpe wrote:
>> > +{
>> > +   return kref_put(&dev->ref, nvmet_rdma_free_device);
>> > +}
>> > +
>> > +static int nvmet_rdma_dev_get(struct nvmet_rdma_device *dev)
>> > +{
>> > +   return kref_get_unless_zero(&dev->ref);
>> > +}
>>
>> Don't wrap get_unless_zero with something called get..
>
> Agreed.  And I hate all these wrappers.  Either we use kref_*
> or we use wrappers and plain refcount_* ops, not both.

What I did not mention in the commit message is that this is
done only to unify the code with host/rdma.c, which has
exactly the same wrappers.  Since I am touching both sides
(host and target) this code difference annoys.

You think better to remove wrappers from nvme host or just
leave everything as is?

--
Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux