| .. | .. |
|---|
| 38 | 38 | } |
|---|
| 39 | 39 | } |
|---|
| 40 | 40 | |
|---|
| 41 | +/** |
|---|
| 42 | + * hlist_nulls_first_rcu - returns the first element of the hash list. |
|---|
| 43 | + * @head: the head of the list. |
|---|
| 44 | + */ |
|---|
| 41 | 45 | #define hlist_nulls_first_rcu(head) \ |
|---|
| 42 | 46 | (*((struct hlist_nulls_node __rcu __force **)&(head)->first)) |
|---|
| 43 | 47 | |
|---|
| 48 | +/** |
|---|
| 49 | + * hlist_nulls_next_rcu - returns the element of the list after @node. |
|---|
| 50 | + * @node: element of the list. |
|---|
| 51 | + */ |
|---|
| 44 | 52 | #define hlist_nulls_next_rcu(node) \ |
|---|
| 45 | 53 | (*((struct hlist_nulls_node __rcu __force **)&(node)->next)) |
|---|
| 46 | 54 | |
|---|
| .. | .. |
|---|
| 137 | 145 | } |
|---|
| 138 | 146 | } |
|---|
| 139 | 147 | |
|---|
| 148 | +/* after that hlist_nulls_del will work */ |
|---|
| 149 | +static inline void hlist_nulls_add_fake(struct hlist_nulls_node *n) |
|---|
| 150 | +{ |
|---|
| 151 | + n->pprev = &n->next; |
|---|
| 152 | + n->next = (struct hlist_nulls_node *)NULLS_MARKER(NULL); |
|---|
| 153 | +} |
|---|
| 154 | + |
|---|
| 140 | 155 | /** |
|---|
| 141 | 156 | * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type |
|---|
| 142 | 157 | * @tpos: the type * to use as a loop cursor. |
|---|
| 143 | 158 | * @pos: the &struct hlist_nulls_node to use as a loop cursor. |
|---|
| 144 | | - * @head: the head for your list. |
|---|
| 159 | + * @head: the head of the list. |
|---|
| 145 | 160 | * @member: the name of the hlist_nulls_node within the struct. |
|---|
| 146 | 161 | * |
|---|
| 147 | 162 | * The barrier() is needed to make sure compiler doesn't cache first element [1], |
|---|
| 148 | 163 | * as this loop can be restarted [2] |
|---|
| 149 | 164 | * [1] Documentation/core-api/atomic_ops.rst around line 114 |
|---|
| 150 | | - * [2] Documentation/RCU/rculist_nulls.txt around line 146 |
|---|
| 165 | + * [2] Documentation/RCU/rculist_nulls.rst around line 146 |
|---|
| 151 | 166 | */ |
|---|
| 152 | 167 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ |
|---|
| 153 | 168 | for (({barrier();}), \ |
|---|
| .. | .. |
|---|
| 161 | 176 | * iterate over list of given type safe against removal of list entry |
|---|
| 162 | 177 | * @tpos: the type * to use as a loop cursor. |
|---|
| 163 | 178 | * @pos: the &struct hlist_nulls_node to use as a loop cursor. |
|---|
| 164 | | - * @head: the head for your list. |
|---|
| 179 | + * @head: the head of the list. |
|---|
| 165 | 180 | * @member: the name of the hlist_nulls_node within the struct. |
|---|
| 166 | 181 | */ |
|---|
| 167 | 182 | #define hlist_nulls_for_each_entry_safe(tpos, pos, head, member) \ |
|---|