summaryrefslogtreecommitdiffstats
path: root/include/linux/rculist.h
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-02-22 07:57:17 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-22 15:45:54 -0800
commit1cc523271ef0b6305c565a143e3d48f6fff826dd (patch)
tree8acfcce42d5d81e4ce993c078985bfc3789bf2c5 /include/linux/rculist.h
parent35e2da46d25a53e0e19956f533cc29272a6cceb2 (diff)
downloadblackbird-op-linux-1cc523271ef0b6305c565a143e3d48f6fff826dd.tar.gz
blackbird-op-linux-1cc523271ef0b6305c565a143e3d48f6fff826dd.zip
seq_file: add RCU versions of new hlist/list iterators (v3)
Many usages of seq_file use RCU protected lists, so non RCU iterators will not work safely. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rculist.h')
-rw-r--r--include/linux/rculist.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 1bf0f708c4fc..701fe9cb552a 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -406,6 +406,11 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
n->next->pprev = &n->next;
}
+#define __hlist_for_each_rcu(pos, head) \
+ for (pos = rcu_dereference((head)->first); \
+ pos && ({ prefetch(pos->next); 1; }); \
+ pos = rcu_dereference(pos->next))
+
/**
* hlist_for_each_entry_rcu - iterate over rcu list of given type
* @tpos: the type * to use as a loop cursor.
OpenPOWER on IntegriCloud