[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191210042002.3490-9-paulmck@kernel.org>
Date: Mon, 9 Dec 2019 20:20:02 -0800
From: paulmck@...nel.org
To: rcu@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, kernel-team@...com, mingo@...nel.org,
jiangshanlai@...il.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, tglx@...utronix.de, peterz@...radead.org,
rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
fweisbec@...il.com, oleg@...hat.com, joel@...lfernandes.org,
Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>,
"Paul E . McKenney" <paulmck@...nel.org>
Subject: [PATCH tip/core/rcu 9/9] rculist.h: Add list_tail_rcu()
From: Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>
This patch adds the macro list_tail_rcu() and documents it.
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>
[ paulmck: Reword a bit. ]
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
---
include/linux/rculist.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 4b7ae1b..9f313e4 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, and even then
+ * 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.9.5
Powered by blists - more mailing lists