aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRobert Olsson <Robert.Olsson@data.slu.se>2005-08-25 16:01:03 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 19:08:31 -0400
commite5b4376074e02b783e56a8f7c42d544e18112c4e (patch)
tree7269e327d5132da92cd5c7238c03266b7c9f391b /include/linux
parent3625796806419d97641d90e0f197eab9b952212e (diff)
[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')
-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 0f2435f92db3..9b9b0eec1e8a 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,
634 next->next->pprev = &next->next; 634 next->next->pprev = &next->next;
635} 635}
636 636
637static inline void hlist_add_before_rcu(struct hlist_node *n,
638 struct hlist_node *next)
639{
640 n->pprev = next->pprev;
641 n->next = next;
642 smp_wmb();
643 next->pprev = &n->next;
644 *(n->pprev) = n;
645}
646
647static inline void hlist_add_after_rcu(struct hlist_node *prev,
648 struct hlist_node *n)
649{
650 n->next = prev->next;
651 n->pprev = &prev->next;
652 smp_wmb();
653 prev->next = n;
654 if (n->next)
655 n->next->pprev = &n->next;
656}
657
637#define hlist_entry(ptr, type, member) container_of(ptr,type,member) 658#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
638 659
639#define hlist_for_each(pos, head) \ 660#define hlist_for_each(pos, head) \