diff options
Diffstat (limited to 'include/linux/rculist_nulls.h')
| -rw-r--r-- | include/linux/rculist_nulls.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h index b70ffe53cb9f..2ae13714828b 100644 --- a/include/linux/rculist_nulls.h +++ b/include/linux/rculist_nulls.h | |||
| @@ -37,6 +37,12 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n) | |||
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | #define hlist_nulls_first_rcu(head) \ | ||
| 41 | (*((struct hlist_nulls_node __rcu __force **)&(head)->first)) | ||
| 42 | |||
| 43 | #define hlist_nulls_next_rcu(node) \ | ||
| 44 | (*((struct hlist_nulls_node __rcu __force **)&(node)->next)) | ||
| 45 | |||
| 40 | /** | 46 | /** |
| 41 | * hlist_nulls_del_rcu - deletes entry from hash list without re-initialization | 47 | * hlist_nulls_del_rcu - deletes entry from hash list without re-initialization |
| 42 | * @n: the element to delete from the hash list. | 48 | * @n: the element to delete from the hash list. |
| @@ -88,7 +94,7 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | |||
| 88 | 94 | ||
| 89 | n->next = first; | 95 | n->next = first; |
| 90 | n->pprev = &h->first; | 96 | n->pprev = &h->first; |
| 91 | rcu_assign_pointer(h->first, n); | 97 | rcu_assign_pointer(hlist_nulls_first_rcu(h), n); |
| 92 | if (!is_a_nulls(first)) | 98 | if (!is_a_nulls(first)) |
| 93 | first->pprev = &n->next; | 99 | first->pprev = &n->next; |
| 94 | } | 100 | } |
| @@ -100,11 +106,11 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | |||
| 100 | * @member: the name of the hlist_nulls_node within the struct. | 106 | * @member: the name of the hlist_nulls_node within the struct. |
| 101 | * | 107 | * |
| 102 | */ | 108 | */ |
| 103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ | 109 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ |
| 104 | for (pos = rcu_dereference_raw((head)->first); \ | 110 | for (pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ |
| 105 | (!is_a_nulls(pos)) && \ | 111 | (!is_a_nulls(pos)) && \ |
| 106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ | 112 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ |
| 107 | pos = rcu_dereference_raw(pos->next)) | 113 | pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) |
| 108 | 114 | ||
| 109 | #endif | 115 | #endif |
| 110 | #endif | 116 | #endif |
