Re: [RFC] kref, a tiny, sane, reference count object

Greg KH
2004-03-13T18:19:34Z

On Sat, Mar 13, 2004 at 02:06:56PM +0100, Andi Kleen wrote:
> Greg KH <greg@kroah.com> writes:
>
> > Comments are appreciated and welcomed.
>
> I really don't see the advantage of this. Writing the same using
> atomic_inc/ atomic_dec_and_test() implicitely is basically as clean,
> and you will save the overhead of carrying a release() pointer
> around. And the "patterns" for that are easy enough that I doubt
> people will get it wrong.

But people do get it wrong (I've seen it happen). Using this keeps you
from having to write your own get, and put functions. Multiply that by
every usb driver that wants to (and needs to) use this kind of logic,
and you have a lot of duplicated code that is unnecessary.

So we write it once, get it correct, and let everyone use it. Isn't
that what the code in /lib is for? :)

thanks,

greg k-h