On Thu, Feb 24, 2005 at 05:27:25PM -0600, Corey Minyard wrote:There's a trick I'm playing to avoid having to use a lock on the normal entry_put() case. It let's the entry_get() routine detect that the object is about to be destroyed. You can't do it with the current kref, but you could easily extend kref to allow it. It's simple to implement, but the documentation on how to use it will be 10 times larger than the code :).
+
+ /* It's wierd, but we use a usecount to track if an q entry is
+ in use and when it should be reported back to the user. */
+ atomic_t usecount;
Please use a kref here instead of rolling your own.
Oh, and can you cc: your patches to the sensors mailing list so thecertainly.
other i2c developers are aware of them and can comment? I'll stick with
just applying your first patch for now.