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

Andi Kleen
2004-03-13T20:46:14Z

Greg KH <greg@kroah.com> writes:

> But people do get it wrong (I've seen it happen). Using this keeps you

If they cannot get a simple reference counter right it is doubtful
the rest of their code will do any good.

> 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.

Lots of duplicated one liners. Sounds like a big issue.
For me this thing smells more like overabstraction.

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

I would agree if it is significant code. But all you're replacing is a
few straight forward one/two liners, and that at the cost of less
efficient space usage (12 byte overhead on 64bit)

-Andi