Re: [PATCH] kref: add function for reading kref value

From: Peter Zijlstra
Date: Mon Dec 12 2011 - 10:29:43 EST


On Mon, 2011-12-12 at 07:02 -0800, Greg KH wrote:
> On Mon, Dec 12, 2011 at 02:44:52PM +0200, Daniel Baluta wrote:
> > We can easily get kref refcount value by accesing
> > kref->refcount but it is better to have a function
> > for this.
>
> No, you should NEVER need the value of the kref, if you do, you are
> doing something wrong.
>
> What code needs this patch?

I very much agree with Greg, those sites that know wth they're doing are
way better off open-coding it like they do now. (I only looked at the
neihgbour.c one, which is creative but not evidently wrong).

Providing a kref_read() function however, suggests its actually a sane
thing to do, its not.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/