while (!mte_is_root(mas->node))
mas_ascend(mas);
return false;
- } else if (l_wr_mas->mas->node == r_wr_mas->mas->node) {
- /* Converged, but caused a cascading split. */
- if (cp->d_count != 1) {
- //mt_dump(mas->tree, mt_dump_hex);
- //printk("At %p\n", l_wr_mas->mas->node);
- //printk("Writing %lx -%lx => %p\n", mas->index, mas->last, l_wr_mas->entry);
- }
- //WARN_ON_ONCE(cp->d_count != 1);
- //cp->dst[0].node->parent = mas_mn(mas)->parent;
- //return false;
}
+ /* Converged and has a single destination */
+ if ((cp->d_count == 1) &&
+ (l_wr_mas->mas->node == r_wr_mas->mas->node)) {
+ cp->dst[0].node->parent = ma_parent_ptr(mas_mn(mas)->parent);
+ return false;
+ }
+
+ MAS_WR_BUG_ON(l_wr_mas, cp->height > 4);
cp->height++;
wr_mas_ascend(l_wr_mas);
wr_mas_ascend(r_wr_mas);