summaryrefslogtreecommitdiffstats
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorRobert Olsson <Robert.Olsson@data.slu.se>2005-08-25 13:01:03 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 16:08:31 -0700
commite5b4376074e02b783e56a8f7c42d544e18112c4e (patch)
tree7269e327d5132da92cd5c7238c03266b7c9f391b /include/linux/list.h
parent3625796806419d97641d90e0f197eab9b952212e (diff)
downloadop-kernel-dev-e5b4376074e02b783e56a8f7c42d544e18112c4e.zip
op-kernel-dev-e5b4376074e02b783e56a8f7c42d544e18112c4e.tar.gz
[IPV4]: Prepare FIB core for RCU.
* RCU versions of hlist_***_rcu * fib_alias partial rcu port just whats needed now. Signed-off-by: Robert Olsson <Robert.Olsson@data.slu.se> Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 0f2435f..9b9b0ee 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -634,6 +634,27 @@ static inline void hlist_add_after(struct hlist_node *n,
next->next->pprev = &next->next;
}
+static inline void hlist_add_before_rcu(struct hlist_node *n,
+ struct hlist_node *next)
+{
+ n->pprev = next->pprev;
+ n->next = next;
+ smp_wmb();
+ next->pprev = &n->next;
+ *(n->pprev) = n;
+}
+
+static inline void hlist_add_after_rcu(struct hlist_node *prev,
+ struct hlist_node *n)
+{
+ n->next = prev->next;
+ n->pprev = &prev->next;
+ smp_wmb();
+ prev->next = n;
+ if (n->next)
+ n->next->pprev = &n->next;
+}
+
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
#define hlist_for_each(pos, head) \
OpenPOWER on IntegriCloud