kref, a tiny, sane, reference count object
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Greg KH
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.
-Andi
Quoted 9 lines · Andi Kleen
Quoted 1 line · Greg KH
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 arelease()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