Skip to content

Commit afa47fd

Browse files
Madhuparna04paulmckrcu
authored andcommitted
rculist.h: Add list_tail_rcu()
This patch adds the macro list_tail_rcu() and documents it. Signed-off-by: Madhuparna Bhowmik <[email protected]> [ paulmck: Reword a bit. ] Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 459b528 commit afa47fd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/linux/rculist.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list)
4040
*/
4141
#define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next)))
4242

43+
/**
44+
* list_tail_rcu - returns the prev pointer of the head of the list
45+
* @head: the head of the list
46+
*
47+
* Note: This should only be used with the list header, and even then
48+
* only if list_del() and similar primitives are not also used on the
49+
* list header.
50+
*/
51+
#define list_tail_rcu(head) (*((struct list_head __rcu **)(&(head)->prev)))
52+
4353
/*
4454
* Check during list traversal that we are within an RCU reader
4555
*/

0 commit comments

Comments
 (0)