aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rculist.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rculist.h')
-rw-r--r--include/linux/rculist.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index dbaf99084112..8183b46fbaa2 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -247,9 +247,10 @@ static inline void list_splice_init_rcu(struct list_head *list,
247 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). 247 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
248 */ 248 */
249#define list_entry_rcu(ptr, type, member) \ 249#define list_entry_rcu(ptr, type, member) \
250 ({typeof (*ptr) __rcu *__ptr = (typeof (*ptr) __rcu __force *)ptr; \ 250({ \
251 container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ 251 typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \
252 }) 252 container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \
253})
253 254
254/** 255/**
255 * Where are list_empty_rcu() and list_first_entry_rcu()? 256 * Where are list_empty_rcu() and list_first_entry_rcu()?
@@ -285,11 +286,11 @@ static inline void list_splice_init_rcu(struct list_head *list,
285 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). 286 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
286 */ 287 */
287#define list_first_or_null_rcu(ptr, type, member) \ 288#define list_first_or_null_rcu(ptr, type, member) \
288 ({struct list_head *__ptr = (ptr); \ 289({ \
289 struct list_head *__next = ACCESS_ONCE(__ptr->next); \ 290 struct list_head *__ptr = (ptr); \
290 likely(__ptr != __next) ? \ 291 struct list_head *__next = ACCESS_ONCE(__ptr->next); \
291 list_entry_rcu(__next, type, member) : NULL; \ 292 likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \
292 }) 293})
293 294
294/** 295/**
295 * list_for_each_entry_rcu - iterate over rcu list of given type 296 * list_for_each_entry_rcu - iterate over rcu list of given type