enum maple_type type;
unsigned long pivot, max, min;
unsigned char pivot_cnt, i;
- bool leaf = false, found = false;
+ bool found = false;
min = mas->min;
max = mas->max;
type = mt_node_type(mas->node);
pivot_cnt = mt_pivots[type];
- if (type < maple_range_16)
- leaf = true;
switch (type) {
case maple_leaf_64:
}
- if (!leaf) { // descend.
+ if (type >= maple_range_16) { //descend
struct maple_enode *next;
next = _ma_get_rcu_slot(mas->node, i, type);
mas->min = min;
do {
if (ma_is_root(mas->node)) {
slot = ma_get_slot(mas);
- if (slot >= mt_slot_count(mas->node) - 1) {
+ if (slot > mt_slot_count(mas->node) - 1) {
mas_set_err(mas, -EBUSY);
return false;
}
slot = mt_parent_slot(mas->node);
ma_encoded_parent(mas);
}
- } while (slot >= mt_slot_count(mas->node) - 1);
+ } while (slot > mt_slot_count(mas->node) - 1);
ma_set_slot(mas, ++slot);
mas_update_limits(mas, slot, mt_node_type(mas->node));