diff options
Diffstat (limited to 'include/linux/rculist.h')
-rw-r--r-- | include/linux/rculist.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 2c9b46cff3d7..4ec3b38ce9c5 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -428,5 +428,47 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
429 | pos = rcu_dereference_raw(pos->next)) | 429 | pos = rcu_dereference_raw(pos->next)) |
430 | 430 | ||
431 | /** | ||
432 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type | ||
433 | * @tpos: the type * to use as a loop cursor. | ||
434 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
435 | * @head: the head for your list. | ||
436 | * @member: the name of the hlist_node within the struct. | ||
437 | * | ||
438 | * This list-traversal primitive may safely run concurrently with | ||
439 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | ||
440 | * as long as the traversal is guarded by rcu_read_lock(). | ||
441 | */ | ||
442 | #define hlist_for_each_entry_rcu_bh(tpos, pos, head, member) \ | ||
443 | for (pos = rcu_dereference_bh((head)->first); \ | ||
444 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
445 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
446 | pos = rcu_dereference_bh(pos->next)) | ||
447 | |||
448 | /** | ||
449 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point | ||
450 | * @tpos: the type * to use as a loop cursor. | ||
451 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
452 | * @member: the name of the hlist_node within the struct. | ||
453 | */ | ||
454 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ | ||
455 | for (pos = rcu_dereference((pos)->next); \ | ||
456 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
457 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
458 | pos = rcu_dereference(pos->next)) | ||
459 | |||
460 | /** | ||
461 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point | ||
462 | * @tpos: the type * to use as a loop cursor. | ||
463 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
464 | * @member: the name of the hlist_node within the struct. | ||
465 | */ | ||
466 | #define hlist_for_each_entry_continue_rcu_bh(tpos, pos, member) \ | ||
467 | for (pos = rcu_dereference_bh((pos)->next); \ | ||
468 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
469 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
470 | pos = rcu_dereference_bh(pos->next)) | ||
471 | |||
472 | |||
431 | #endif /* __KERNEL__ */ | 473 | #endif /* __KERNEL__ */ |
432 | #endif | 474 | #endif |