This patch adds the macro list_tail_rcu() and documents it.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) · 39 unmodified lines | ||
| 40 | 40 | */ |
| 41 | 41 | #define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next))) |
| 42 | 42 | |
| 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 | + | |
| 43 | 53 | /* |
| 44 | 54 | * Check during list traversal that we are within an RCU reader |
| 45 | 55 | */ |