left.node = mt_mk_node(ma_mnode_ptr(mas_next_alloc(mas)), type);
right.node = mt_mk_node(ma_mnode_ptr(mas_next_alloc(mas)), type);
- mte_set_parent(left.node, new_parent, p_slot);
- mte_set_parent(right.node, new_parent, p_slot+1);
+ mte_set_parent(left.node, mte_to_node(new_parent), p_slot);
+ mte_set_parent(right.node, mte_to_node(new_parent), p_slot+1);
// split the data into left & right and do the insert.
split = mas_ma_cp(mas, p_slot, &left, &right, NULL, type, 0, entry_cnt,
entry, 0);
error:
if (new_mas.tree)
mte_destroy_walk(new_mas.tree->ma_root);
+ printk("Failed on %lu-%lu\n", mas->index, mas->last);
+ mt_dump(mas->tree);
BUG_ON(1);
return 0;
}
}
EXPORT_SYMBOL(mtree_load);
-int mtree_store_range(struct maple_tree *mt, unsigned long first,
+int mtree_store_range(struct maple_tree *mt, unsigned long index,
unsigned long last, void *entry, gfp_t gfp)
{
- MA_STATE(mas, mt, first, last);
+ MA_STATE(mas, mt, index, last);
if (WARN_ON_ONCE(mt_is_advanced(entry)))
return -EINVAL;
- if (first > last)
+ if (index > last)
return -EINVAL;
mas_lock(&mas);