Skip to content

Commit

Permalink
rculist.h: Add list_tail_rcu()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Madhuparna04 authored and paulmckrcu committed Jan 10, 2020
1 parent 459b528 commit afa47fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/linux/rculist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit afa47fd

Please sign in to comment.