lkml.org 
[lkml]   [2010]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 02/19] kernel: add bl_list
    On Sat, Oct 16, 2010 at 07:13:56PM +1100, Dave Chinner wrote:
    > From: Nick Piggin <npiggin@suse.de>
    > +/**
    > + * hlist_bl_lock - lock a hash list
    > + * @h: hash list head to lock
    > + */
    > +static inline void hlist_bl_lock(struct hlist_bl_head *h)
    > +{
    > + bit_spin_lock(0, (unsigned long *)h);
    > +}
    > +
    > +/**
    > + * hlist_bl_unlock - unlock a hash list
    > + * @h: hash list head to unlock
    > + */
    > +static inline void hlist_bl_unlock(struct hlist_bl_head *h)
    > +{
    > + __bit_spin_unlock(0, (unsigned long *)h);
    > +}

    I don't know why Christoph asked for these; he's usually against
    obfuscating wrapper functions.

    bit_spin_lock is fine in callers so please leave it at that.
    Other users may not want a spinlock, or might want to use
    bit_spin_is_locked, bit_spin_trylock etc.


    > diff --git a/include/linux/poison.h b/include/linux/poison.h
    > index 2110a81..d367d39 100644
    > --- a/include/linux/poison.h
    > +++ b/include/linux/poison.h
    > @@ -22,6 +22,8 @@
    > #define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA)
    > #define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA)
    >
    > +#define BL_LIST_POISON1 ((void *) 0x00300300 + POISON_POINTER_DELTA)
    > +#define BL_LIST_POISON2 ((void *) 0x00400400 + POISON_POINTER_DELTA)
    > /********** include/linux/timer.h **********/
    > /*
    > * Magic number "tsta" to indicate a static timer initializer

    I don't see the point of this, but if there is one it should be
    documented in a different patch and propagated to other types of
    lists too. I wouldn't worry about it though.



    \
     
     \ /
      Last update: 2010-10-16 11:55    [W:0.032 / U:120.452 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site