*/
static inline void cds_list_add_rcu(struct cds_list_head *newp, struct cds_list_head *head)
{
- newp->next = head->next;
+ struct cds_list_head *first = head->next;
+
+ newp->next = first;
newp->prev = head;
- cmm_smp_wmb();
- head->next->prev = newp;
- head->next = newp;
+ rcu_assign_pointer(head->next, newp);
+ first->prev = newp;
}
/* replace an old entry atomically.
static inline void cds_list_del_rcu(struct cds_list_head *elem)
{
elem->next->prev = elem->prev;
- elem->prev->next = elem->next;
+ CMM_STORE_SHARED(elem->prev->next, elem->next);
}
/*