Use rcu_assign_pointer() to store into head->next in
cds_hlist_add_head_rcu(). This includes the write barrier needed before
publishing the new node.
Use CMM_STORE_SHARED() to store into elem->prev->next in
cds_hlist_del_rcu().
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
{
newp->next = head->next;
newp->prev = (struct cds_hlist_node *)head;
- cmm_smp_wmb();
if (head->next)
head->next->prev = newp;
- head->next = newp;
+ rcu_assign_pointer(head->next, newp);
}
/* Remove element from list. */
{
if (elem->next)
elem->next->prev = elem->prev;
- elem->prev->next = elem->next;
+ CMM_STORE_SHARED(elem->prev->next, elem->next);
}
/*