lkml.org 
[lkml]   [2004]   [Aug]   [3]   [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, Aug 02, 2004 at 01:08:49PM -0700, Greg KH wrote:
    > On Mon, Jul 26, 2004 at 05:31:51PM +0100, Christoph Hellwig wrote:
    > > 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.
    >

    Really, there is no need to use kref in where Ravikiran is using
    them (VFS) under the current circumstances. However, if lock-free
    lookup using RCU is to be used, Ravikiran needs to use an abstracted reference
    counter API. This is to optimally support platforms with and without
    cmpxchg. kref is the standard reference counter API at the moment and
    that is where it made sense to add the abstracted lockfree reference counter
    support.

    So, kref_read() as it is would look weird. But if we consider merging
    the rest of the kref APIs (lock-free extensions) in future, then the
    entire set including kref_read() would make sense.

    Thanks
    Dipankar
    -
    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:3.918 / U:2.544 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site