summaryrefslogtreecommitdiff
path: root/include/linux/rculist.h
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2009-11-10 10:54:47 +0300
committerDavid S. Miller <davem@davemloft.net>2009-11-11 09:26:29 +0300
commit254245d23396aca1f9100d500163d7bd6019ab6f (patch)
tree3176ba0db8478094d4d5187c20d00be9880d9acf /include/linux/rculist.h
parent856540ee3116ac04a49bc06c2f30f54dd3faf7db (diff)
downloadlinux-254245d23396aca1f9100d500163d7bd6019ab6f.tar.xz
netdev: add netdev_continue_rcu
This adds an RCU macro for continuing search, useful for some network devices like vlan. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rculist.h')
-rw-r--r--include/linux/rculist.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 5710f43bbc9e..1bf0f708c4fc 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -262,6 +262,20 @@ static inline void list_splice_init_rcu(struct list_head *list,
(pos) = rcu_dereference((pos)->next))
/**
+ * list_for_each_entry_continue_rcu - continue iteration over list of given type
+ * @pos: the type * to use as a loop cursor.
+ * @head: the head for your list.
+ * @member: the name of the list_struct within the struct.
+ *
+ * Continue to iterate over list of given type, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue_rcu(pos, head, member) \
+ for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \
+ prefetch(pos->member.next), &pos->member != (head); \
+ pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
+
+/**
* hlist_del_rcu - deletes entry from hash list without re-initialization
* @n: the element to delete from the hash list.
*