From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 07/10 v7] sunrpc: Switch to using list_head instead single list Date: Sat, 11 Jul 2015 05:54:26 -0700 Message-ID: <20150711125426.GA16906@infradead.org> References: <55A11010.6050005@gmail.com> <55A11112.8080502@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , "J. Bruce Fields" , "linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, NeilBrown , Trond Myklebust To: Kinglong Mee Return-path: Content-Disposition: inline In-Reply-To: <55A11112.8080502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org > + struct list_head * hash_table; For hash lists it might be useful to use a hlist_head structure, as that avoids bloating the actual hash table while still allowing easy removal of an entry. > - for (hp=head; *hp != NULL ; hp = &(*hp)->next) { > - struct cache_head *tmp = *hp; > + list_for_each_safe(pos, tpos, head) { > + tmp = list_entry(pos, struct cache_head, cache_list); Please use the _entry iteration macros that consolidate these two. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html