}
/*
- * mas_wmb_replace() - Write memory barrier and replace
+ * mas_cleanup_replace() - Free any necessary nodes and insert the new sub-tree
* @mas: The maple state
* @free: the maple topiary list of nodes to free
* @destroy: The maple topiary list of nodes to destroy (walk and free)
*
* Updates gap as necessary.
*/
-static inline void mas_wmb_replace(struct ma_state *mas,
- struct ma_topiary *free,
- struct ma_topiary *destroy)
+static inline void mas_cleanup_replace(struct ma_state *mas,
+ struct ma_topiary *free, struct ma_topiary *destroy)
{
- /* All nodes must see old data as dead prior to replacing that data */
- smp_wmb(); /* Needed for RCU */
-
/* Insert the new data in the tree */
mas_replace(mas, true);
mast->orig_l->depth = mas->depth;
mast->orig_l->alloc = mas->alloc;
*mas = *mast->orig_l;
- mas_wmb_replace(mas, &free, &destroy);
+ mas_cleanup_replace(mas, &free, &destroy);
mtree_range_walk(mas);
return mast->bn->b_end;
}
/* Set the original node as dead */
mat_add(mast.free, mas->node);
mas->node = l_mas.node;
- mas_wmb_replace(mas, mast.free, NULL);
+ mas_cleanup_replace(mas, mast.free, NULL);
mtree_range_walk(mas);
return 1;
}