/* Direct node to node copy */
static inline
-unsigned char node_copy(struct maple_node *src, unsigned char start,
+unsigned long node_copy(struct maple_node *src, unsigned char start,
unsigned char size, unsigned long s_max, enum maple_type s_mt,
struct maple_node *dst, unsigned char d_start, enum maple_type d_mt)
{
unsigned long *s_pivots, *d_pivots;
unsigned long *s_gaps, *d_gaps;
bool set_last_piv = true;
+ unsigned long d_max;
s_slots = ma_slots(src, s_mt) + start;
d_slots = ma_slots(dst, d_mt) + d_start;
set_last_piv = false;
size--;
d_pivots[size] = s_max;
+ d_max = s_max;
+ } else {
+ d_max = *(s_pivots + size - 1);
}
if (size)
if (set_last_piv)
d_pivots[size] = s_max;
- return size;
+ return d_max;
}
static inline
data_offset = 0;
next_node = split;
do {
+ unsigned long d_max;
+
do {
size = next_node - data_offset;
printk("try to use size %d\n", size);
printk("%d: size %u\n", __LINE__, size);
size++;
- node_copy(src, s_offset, size, s_max, s_mt,
+ d_max = node_copy(src, s_offset, size, s_max, s_mt,
dst, dst_offset, d_mt);
data_offset += size;
/* This source is exhausted */
s++;
if (s >= cp->s_count) {
+ cp->dst[d].max = d_max;
node_finalise(dst, d_mt, dst_offset);
return;
}
data_offset--;
dst_offset--;
}
+ cp->dst[d].max = d_max;
node_finalise(dst, d_mt, dst_offset);
mt_dump_node(mas->tree, mt_mk_node(dst, d_mt), 0, ULONG_MAX, 1, mt_dump_hex);
if (d >= cp->d_count) {