static inline void cp_dst_to_slots(struct maple_copy *cp, unsigned long min,
- struct ma_state *mas)
+ unsigned long max, struct ma_state *mas)
{
unsigned char d;
min = max + 1;
}
+ cp->end = cp->d_count - 1;
+ cp->min = min;
+ cp->max = max;
}
static inline void rebalance_new_root(struct maple_copy *cp, struct ma_state *mas)
*r_wr_mas->mas = *sib;
}
- cp_dst_to_slots(cp, l_wr_mas->mas->min, mas);
- cp->end = cp->d_count - 1;
- cp->min = l_wr_mas->mas->min;
- cp->max = r_wr_mas->mas->max;
-
+ cp_dst_to_slots(cp, l_wr_mas->mas->min, r_wr_mas->mas->max, mas);
if (!cp->min && cp->max == ULONG_MAX) {
rebalance_new_root(cp, mas);
return false;
r = mas;
}
- cp_dst_to_slots(cp, min, mas);
- cp->end = cp->d_count - 1;
- cp->min = l->min;
- cp->max = r->max;
-
+ cp_dst_to_slots(cp, min, r->max, mas);
if (!cp->min && cp->max == ULONG_MAX) {
rebalance_new_root(cp, mas);
return false;