From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [patch 01/52] kernel: add bl_list Date: Fri, 25 Jun 2010 00:42:28 +1000 Message-ID: <20100624144228.GC10441@laptop> References: <20100624030212.676457061@suse.de> <20100624030725.718438579@suse.de> <1277359462.3471.1156.camel@edumazet-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, John Stultz , Frank Mayhar To: Eric Dumazet Return-path: Received: from cantor2.suse.de ([195.135.220.15]:57244 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755464Ab0FXOme (ORCPT ); Thu, 24 Jun 2010 10:42:34 -0400 Content-Disposition: inline In-Reply-To: <1277359462.3471.1156.camel@edumazet-laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jun 24, 2010 at 08:04:22AM +0200, Eric Dumazet wrote: > Le jeudi 24 juin 2010 =E0 13:02 +1000, npiggin@suse.de a =E9crit : > > +static inline void hlist_bl_set_first(struct hlist_bl_head *h, str= uct hlist_bl_node *n) > > +{ > > + h->first =3D (struct hlist_bl_node *)((unsigned long)n | ((unsign= ed long)h->first & 1UL)); >=20 > Hmm, shouldnt hlist_bl_set_first() be used only with bit lock held ? >=20 > h->first =3D (struct hlist_bl_node *)((unsigned long)n | 1UL); > > +} I had it that way but changed it for some reason. Thinking about it again though, you're right I'm sure (it could have been some other bug in my code making me think I needed it). Thanks. > > +static inline void hlist_bl_set_first_rcu(struct hlist_bl_head *h,= struct hlist_bl_node *n) > > +{ > > + rcu_assign_pointer(h->first, (struct hlist_bl_node *)((unsigned l= ong)n | ((unsigned long)h->first & 1UL))); >=20 > Same question here. >=20 > > +} > > + > > +static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlis= t_bl_head *h) > > +{ > > + return (struct hlist_bl_node *)((unsigned long)rcu_dereference(h-= >first) & ~1UL); > > +} >=20 >=20 > Looks really nice Nick, maybe we should push this so that other > subsystem can start using it. Sure, if you have an interest in using it, it will be trivial to send upstream. Should we merge it before any users appear? I don't know... -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html