[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101008103352.GD4681@dastard>
Date: Fri, 8 Oct 2010 21:33:52 +1100
From: Dave Chinner <david@...morbit.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/18] kernel: add bl_list
On Fri, Oct 08, 2010 at 10:18:40AM +0200, Andi Kleen wrote:
> Dave Chinner <david@...morbit.com> writes:
>
> > +static inline void __hlist_bl_del(struct hlist_bl_node *n)
> > +{
> > + struct hlist_bl_node *next = n->next;
> > + struct hlist_bl_node **pprev = n->pprev;
> > +
> > + LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK);
> > +
> > + /* pprev may be `first`, so be careful not to lose the lock bit */
> > + *pprev = (struct hlist_bl_node *)
> > + ((unsigned long)next |
> > + ((unsigned long)*pprev & LIST_BL_LOCKMASK));
> > + if (next)
> > + next->pprev = pprev;
> > +}
>
> Should this set n->pprev to NULL so that unhashed returns true
> afterwards?
No, I think the callers set that appropriately.
> > +
> > +static inline void hlist_bl_del(struct hlist_bl_node *n)
> > +{
> > + __hlist_bl_del(n);
> > + n->next = BL_LIST_POISON1;
> > + n->pprev = BL_LIST_POISON2;
> > +}
>
> Ok so unhashed only works once. Seems unsymmetric.
Exactly the same behaviour as hlist_del(). If you want
hlist_bl_unhashed() to work, you need to call hlist_bl_del_init().
/me makes a note to check all the inode hash code uses hlist_bl_del_init()
as there are unhashed checks in many places.
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists