Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3806454ybl; Sun, 8 Dec 2019 23:54:39 -0800 (PST) X-Google-Smtp-Source: APXvYqweb5u80I6S3Pg38o5cXtoucN2aaOOJu5/aEcD60GY2fbWeJydbt0jmNUqR+71vmf7cK05y X-Received: by 2002:aca:4b93:: with SMTP id y141mr23839714oia.132.1575878079505; Sun, 08 Dec 2019 23:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575878079; cv=none; d=google.com; s=arc-20160816; b=yb+qrMuwI9Dtmz01QY+RxGx2qYjNkcPjdzfUiJrsB8oUSKH25tDRssacLzW/QOU88o rCdiqMFdpR27KQgWi5FViHwqAbCBlSBEXk/yV2B/gm4GsBoX8kK/pN9z2gXlvMkGS6It m7+4hNe2pynFu35eHiYsLGGDcXfPrI2mNqQsEuOeO29NxmhqZDEjvOH7kShnLaFfadhD ihnmKnR8MkTQHa3673/hL/iXro//k+ROXuEUUmZtmQJK4gB0L1DD1jBAr4LT4Jxz2t0I EBGjlTM2cckf0IsGvmw/bSm0UG9G5tsTxS2abL9dK6iwGQivcY4AttcIubGiaCM4ERD4 jYRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=T93KpotdGkFqtc77qF2EAzOUEnvgTHpxwI5GuqbP7b4=; b=r4lD3e58lpJCDS2Pciem+5+9TQzxYOeyJIlAt+KVRv+C84dXhAF1G4lt3IqL2SorJG iO+pdGdUc2rA2IhBhLfnP7S6jUGL49YJh9zLOYrDHKwsTodhkhR8rDKCC+BVZVA7is23 Up4g+0nFTBjkSRYDTDJf30emh14i2fsZ3GkNMLwLpX7edpBo8bynmUdj9QByvHLPPmFn Q22KSO93uyT2xxNk6E4UExi36UcmlnuCJ80WIw0yQU1GdxAF6naW/biXA+Zyq14PHpf+ wPI3+r1zl81/iqExk6xYU1YzhA4Fi6KrQteaLSGo78iwGjhHC1C8qXUJYJ7L75c+qkwF defw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N79GCO9l; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si11417501oif.122.2019.12.08.23.54.27; Sun, 08 Dec 2019 23:54:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N79GCO9l; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbfLIHvE (ORCPT + 99 others); Mon, 9 Dec 2019 02:51:04 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33113 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727023AbfLIHvE (ORCPT ); Mon, 9 Dec 2019 02:51:04 -0500 Received: by mail-pf1-f195.google.com with SMTP id y206so6793944pfb.0; Sun, 08 Dec 2019 23:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=T93KpotdGkFqtc77qF2EAzOUEnvgTHpxwI5GuqbP7b4=; b=N79GCO9lrJQ9kFidXylgJv1/NvbaQAqEtR6ip+va41MyO8Wgd+bFaBgZEiMHDCDrVq /O7SGbGzDccjAXV+VBWPQxIv1atxpYo3eQLR5auqJD4thxtmZvN+aL3Yytab6RYvg9lv 1V6p6yZ/oPNWMWtS6hQQjdoTItOaYTHN1hiV3bLulK+0xwjDK2U+yp9wJ+nWKG2Wq07f G6LBjWE+zT+vPRZPAfr68TWQb/hn3uJUYymefKC/jQt7eKAhNf0qBtURZgB1PtIS0Q5e DDE9Li0cONlHxzXeylpBE04Z2FrtzF8auwGonb4CCCVaDr2H5kpXJEVBustMlQqKcSlt s5pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=T93KpotdGkFqtc77qF2EAzOUEnvgTHpxwI5GuqbP7b4=; b=uI2hccKbWAcBaDU8OfRrNHGv9NjBAWrRVvmowIg0aX3WK6069zraJYMQPuTpsxKUnb 67/zyk/rNnBYSkSJYJceYmFnjxUmEGe8FfOBkJkawHLMgj6DkkjxGt3GuZy5LM14dT7F 4rh+mJ1N6Ky45XI+jKzApPoeDttpl5UXLJpB95WpCpmavVcdTJ4oiy15GkeRftm7FDmm ichtWK822XftG2Putu1ZEXxf/ozr4q21UkhinxDVa1vaSm+7UxT257dAxqP4r05s8ria WE3qB1VceWLSW1eaV1Tum7zpWSBgtpyI8aWupk1Cx3eMt1rLwqFJzkGr4KZhmu4F9uDQ 3VpA== X-Gm-Message-State: APjAAAXIz+uFDgyuUeYCkIZmAFTEkbiHs2QowUox13TOslQcKrTdR00m 6WMXzH82V0Iut0+ktoGQx6WJuV1DAyQ= X-Received: by 2002:aa7:8096:: with SMTP id v22mr976843pff.240.1575877863074; Sun, 08 Dec 2019 23:51:03 -0800 (PST) Received: from localhost.localdomain ([2402:3a80:13bf:5229:e955:851e:da75:6e07]) by smtp.gmail.com with ESMTPSA id z10sm2881079pfa.184.2019.12.08.23.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2019 23:51:02 -0800 (PST) From: madhuparnabhowmik04@gmail.com To: paulmck@kernel.org, joel@joelfernandes.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Madhuparna Bhowmik Subject: [PATCH] rculist.h: Add list_tail_rcu() Date: Mon, 9 Dec 2019 13:20:43 +0530 Message-Id: <20191209075043.17947-1-madhuparnabhowmik04@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madhuparna Bhowmik This patch adds the macro list_tail_rcu() and document it. Signed-off-by: Madhuparna Bhowmik --- include/linux/rculist.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 4b7ae1bf50b3..9f21efa525ab 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h @@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) */ #define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next))) +/** + * list_tail_rcu - returns the prev pointer of the head of the list + * @head: the head of the list + * + * Note: This should only be used with the list header, + * but only if list_del() and similar primitives are not + * also used on the list header. + */ +#define list_tail_rcu(head) (*((struct list_head __rcu **)(&(head)->prev))) + /* * Check during list traversal that we are within an RCU reader */ -- 2.17.1