Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp7484imb; Thu, 28 Feb 2019 14:15:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxNq092F6dxfBoSMZe4k/aibdOfIuvWNEIdWjrQ7YuZDdaRt6CImJMsWJExat3lKWIb4Cgz X-Received: by 2002:a17:902:4d46:: with SMTP id o6mr1707678plh.302.1551392127349; Thu, 28 Feb 2019 14:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551392127; cv=none; d=google.com; s=arc-20160816; b=z6Xg9+3LTT/lQeituCeQZ9YoDuIdGJKg7zwBd3pzi6Ym8r1lEPWEagIc2H9lvh+1bA ovE9mx8sJXkFvE9OOjXHLtgW6YqlFHBeNRpicCgQlrCfcynuwI4nYiiRAgsvmDDdzDrD qLqAe6IyYNqRt8ytw9d5341kERAgEuDVqIPpaFbhlgQ9hgRavOds0KZzy+ZLqYivldoF gAXcBTxlE7kCQqxv0wIXXk4H/UmjAh2zkqq9mc1n7iOdAfvSduduf/JDainL341n4fPH PI9IHb6TRFOhXwnBlmiZdYRbojEY4xEk5bHKC+7BClqvjRV6K6tLtg+VMBm7G+7Hofxb 4t2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Zc4BIvW/0I1WWD77jbCTfkfPnPhl8fQR+ncSe8RKmfc=; b=aufiwT/Xz6eG1YXVLOhygk0z8B/kpUEabLJcjoZGZJpvNLw2Qczov7qaD9Tw0Y52yT 0ZA0Q5E+FUTkqg09nhlkJlpMJfoBpbwuCJpnJLry2PciL1oREacAvy7eJMcjGlCd+yyH k1F70UczSVUzbjDoqloLpj9Qj5JrP0qQq006jocN5HJ9DBRLZl8XGIgVj0qxTR6aEnFy GLM5EQxkZhXx0yjZnMpiA8i6o51+J1aqntYmejVqdLoJ2B7vVxuAZrdp0BuQOAMQECn9 TIyk5s1lQQHRPeIvIlw7hMPnHM/wg/TD+tdWnyZA48pQbCjc53wnJFV4ttMNTwXi5VdN pj8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62si17748716pge.403.2019.02.28.14.15.11; Thu, 28 Feb 2019 14:15:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730845AbfB1Vew (ORCPT + 99 others); Thu, 28 Feb 2019 16:34:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41478 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727775AbfB1Vew (ORCPT ); Thu, 28 Feb 2019 16:34:52 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C4E33145730; Thu, 28 Feb 2019 21:34:52 +0000 (UTC) Received: from localhost (unknown [10.18.25.174]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A23D75DD74; Thu, 28 Feb 2019 21:34:49 +0000 (UTC) Date: Thu, 28 Feb 2019 16:34:48 -0500 From: Mike Snitzer To: "Paul E. McKenney" , hch@infradead.org, Nikos Tsironis Cc: agk@redhat.com, dm-devel@redhat.com, mpatocka@redhat.com, iliastsi@arrikto.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] list_bl: Add hlist_bl_add_before/behind helpers Message-ID: <20190228213448.GG23527@redhat.com> References: <20181220180651.4879-1-ntsironis@arrikto.com> <20181220180651.4879-2-ntsironis@arrikto.com> <20190228213201.GB23527@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190228213201.GB23527@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 28 Feb 2019 21:34:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 28 2019 at 4:32pm -0500, Mike Snitzer wrote: > On Thu, Dec 20 2018 at 1:06pm -0500, > Nikos Tsironis wrote: > > > Add hlist_bl_add_before/behind helpers to add an element before/after an > > existing element in a bl_list. > > > > Signed-off-by: Nikos Tsironis > > Signed-off-by: Ilias Tsitsimpis > > --- > > include/linux/list_bl.h | 27 +++++++++++++++++++++++++++ > > 1 file changed, 27 insertions(+) > > > > diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h > > index 3fc2cc57ba1b..2fd918e5fd48 100644 > > --- a/include/linux/list_bl.h > > +++ b/include/linux/list_bl.h > > @@ -86,6 +86,33 @@ static inline void hlist_bl_add_head(struct hlist_bl_node *n, > > hlist_bl_set_first(h, n); > > } > > > > +static inline void hlist_bl_add_before(struct hlist_bl_node *n, > > + struct hlist_bl_node *next) > > +{ > > + struct hlist_bl_node **pprev = next->pprev; > > + > > + n->pprev = pprev; > > + n->next = next; > > + next->pprev = &n->next; > > + > > + /* pprev may be `first`, so be careful not to lose the lock bit */ > > + WRITE_ONCE(*pprev, > > + (struct hlist_bl_node *) > > + ((unsigned long)n | > > + ((unsigned long)*pprev & LIST_BL_LOCKMASK))); > > +} > > + > > +static inline void hlist_bl_add_behind(struct hlist_bl_node *n, > > + struct hlist_bl_node *prev) > > +{ > > + n->next = prev->next; > > + n->pprev = &prev->next; > > + WRITE_ONCE(prev->next, n); > > + > > + if (n->next) > > + n->next->pprev = &n->next; > > +} > > + > > static inline void __hlist_bl_del(struct hlist_bl_node *n) > > { > > struct hlist_bl_node *next = n->next; > > -- > > 2.11.0 > > Hi Paul and Christoph, > > You've added your Signed-off-by to include/linux/list_bl.h commits in > the past. I'm not sure how this proposed patch should be handled. > > These new hlist_bl_add_{before,behind} changes are a prereq for > dm-snapshot changes that Nikos has proposed, please see: > https://patchwork.kernel.org/patch/10739265/ > > Any assistance/review you, or others on LKML, might be able to provide > would be appreciated. I should've clarified that: I'm asking for the purpose of getting these changes staged for Linux 5.2. Mike