if (offset >= insert && offset < insert_end) {
copied = min(ma_part->size - part_off, size);
- printk("B:Insert at %u/%u size %u\n", offset, total_data, copied);
+ printk("B: Insert at %u/%u size %u (out of %u)\n", offset, total_data, copied,
+ ma_part->size);
state[i].part = ma_part;
mns_mni_init(&state[i], to, part_off, copied);
state[i].use_part = true;
if (mns_ends_in_null(&state[i])) {
printk("null split, adjust - 1\n");
if (!state[i].use_part && offset != insert) {
+ printk("\tuse_part\n");
state[i].size++;
split++;
offset++;
size--;
node_off++;
} else {
+ printk("\tregular\n");
state[i].size--;
split--;
offset--;
size++;
+ part_off--;
if (!state[i].use_part)
node_off--;
}
/* The rebalance operation will succeed. */
printk("\t\t%s\n", __func__);
- mt_dump(mas->tree, mt_dump_hex);
+ mt_dump(mas->tree, mt_dump_dec);
i = 0;
offset = 0;
total_data = src2.end + new_end + 1;
if (left_store) {
- printk("left store\n");
/* Left pushes data right. */
insert = mas->offset;
+ printk("left store at %u\n", insert);
size = split;
} else {
printk("right store\n");
trace_ma_op(__func__, mas);
printk("\t\t%s\n", __func__);
- mt_dump(mas->tree, mt_dump_hex);
+ mt_dump(mas->tree, mt_dump_dec);
printk ("Store %lu - %lu => %p\n", mas->index, mas->last, wr_mas->entry);
height = mas_mt_height(mas);
mas->depth = height;
left.min = mas->min;
right.max = mas->max;
- mt_dump(wr_mas->mas->tree, mt_dump_hex);
+ mt_dump(wr_mas->mas->tree, mt_dump_dec);
i = mt_wr_split_data(&src_info, &left, &right, &ma_part, split,
mas->offset, split, 0, wr_mas->offset_end,
total, state, 0);
rebalanced:
mas_wmb_replace(mas, src_info.enode);
mtree_range_walk(mas);
- mt_dump(wr_mas->mas->tree, mt_dump_hex);
+ mt_dump(wr_mas->mas->tree, mt_dump_dec);
}
/*