From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbcGSFAw (ORCPT ); Tue, 19 Jul 2016 01:00:52 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:47696 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbcGSFAt (ORCPT ); Tue, 19 Jul 2016 01:00:49 -0400 Date: Tue, 19 Jul 2016 06:00:32 +0100 From: Al Viro To: Waiman Long Cc: Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andi Kleen , Dave Chinner , Boqun Feng , Scott J Norton , Douglas Hatch Subject: Re: [PATCH v3 1/4] lib/dlock-list: Distributed and lock-protected lists Message-ID: <20160719050032.GE2356@ZenIV.linux.org.uk> References: <1468604383-40362-1-git-send-email-Waiman.Long@hpe.com> <1468604383-40362-2-git-send-email-Waiman.Long@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468604383-40362-2-git-send-email-Waiman.Long@hpe.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 01:39:40PM -0400, Waiman Long wrote: > +struct dlock_list_head_percpu { > + struct list_head list; > + spinlock_t lock; > +}; > +#define DLOCK_LIST_HEAD_PERCPU_INIT(name) \ > + { \ > + .list.prev = &name.list, \ > + .list.next = &name.list, \ > + .list.lock = __SPIN_LOCK_UNLOCKED(name), \ What's .list.lock and how does that even compile? > +extern bool dlock_list_next(struct dlock_list_head *dlist, > + struct dlock_list_iter *iter); Ugh... Why not dlist_for_each_entry(), seeing that all users end up with the same boilerplate?