diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2003-04-25 08:24:16 -0700 |
|---|---|---|
| committer | Hideaki Yoshifuji <yoshfuji@linux-ipv6.org> | 2003-04-25 08:24:16 -0700 |
| commit | 36e36b51928808c8df37f3ed77a61dd63cc9cc6d (patch) | |
| tree | 6506cd04415aeb49c8b7098f3b6eeebc477c3f72 /include/linux | |
| parent | b2da2b35ecb26d16da42747a94da10f2c8373ac8 (diff) | |
[BRIDGE]: Use RCU for port table.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/list.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 4178fd498c89..9b8485930659 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -320,6 +320,21 @@ static inline void list_splice_init(struct list_head *list, for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, ({ smp_read_barrier_depends(); 0;}), n = pos->next) +/** + * list_for_each_entry_rcu - iterate over rcu list of given type + * @pos: the type * to use as a loop counter. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_rcu(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + prefetch(pos->member.next); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member), \ + ({ smp_read_barrier_depends(); 0;}), \ + prefetch(pos->member.next)) + + /* * Double linked lists with a single pointer list head. * Mostly useful for hash tables where the two pointer list head is |
