Messages in this thread | | | Date | Mon, 2 Aug 2004 13:08:49 -0700 | From | Greg KH <> | Subject | Re: [patch] Add kref_read and kref_put_last primitives |
| |
On Mon, Jul 26, 2004 at 05:31:51PM +0100, Christoph Hellwig wrote: > On Mon, Jul 26, 2004 at 08:18:56PM +0530, Ravikiran G Thirumalai wrote: > > Greg, > > Here is a patch to add kref_read and kref_put_last. > > These primitives were needed to change files_struct.f_count > > refcounter to use kref api. > > > > kref_put_last is needed sometimes when a refcount might > > have an unconventional release which needs more than > > the refcounted object to process object release-- like in the > > files_struct.f_count conversion patch at __aio_put_req(). > > The following patch depends on kref shrinkage patches. > > (which you have already included). > > Why don't you simply use an atomic_t if that's what you seem to > want?
Exactly. In cases like this, where the user, for some reason, wants to know the state of the reference count, they should not use a struct kref. I'm not going to add these functions to the kref api, sorry.
thanks,
greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |