aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/list.h
diff options
context:
space:
mode:
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 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) \