lkml.org 
[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2 v2] kref: add kref_test_and_get
On Wed, Jan 05, 2011 at 05:43:22PM +0200, Alexey Dobriyan wrote:
> On Wed, Jan 5, 2011 at 5:02 PM, Jerome Marchand <jmarchan@redhat.com> wrote:
> > Add kref_test_and_get() function, which atomically add a reference only if
> > refcount is not zero. This prevent to add a reference to an object that is
> > already being removed.
>
> Is kref supposed to be used only for "toy" structures where you aren't
> expected to do get possibly dead object?

Of course not, have you read the kref documentation?

{sigh}
Why do we even write these things if no one reads them...

greg k-h


\
 
 \ /
  Last update: 2011-01-05 17:03    [from the cache]
©2003-2011 Jasper Spaans