lkml.org 
[lkml]   [2004]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.044 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site