From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-by2nam03on0105.outbound.protection.outlook.com ([104.47.42.105]:14982 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751207AbcGSTBn (ORCPT ); Tue, 19 Jul 2016 15:01:43 -0400 Message-ID: <578E790A.6090403@hpe.com> Date: Tue, 19 Jul 2016 15:01:30 -0400 From: Waiman Long MIME-Version: 1.0 To: Al Viro CC: Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , , , 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 References: <1468604383-40362-1-git-send-email-Waiman.Long@hpe.com> <1468604383-40362-2-git-send-email-Waiman.Long@hpe.com> <20160719050032.GE2356@ZenIV.linux.org.uk> In-Reply-To: <20160719050032.GE2356@ZenIV.linux.org.uk> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/19/2016 01:00 AM, Al Viro wrote: > 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? Yes, it is a typo. This macro is not used. That is why there is no compilation error. I will remove it from the patch. >> +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? Right, I could make a dlock_list_for_each_entry() that encapsulate the boilerplate. I will work on that. Thanks, Longman