unsigned char insert, unsigned char size, unsigned char offset,
unsigned char node_ins_end, unsigned char total_data,
struct ma_node_state *state, int i)
-
{
unsigned char insert_end;
unsigned char node_off, part_off;
}
printk("offset %u node_off %u\n", offset, node_off);
}
+ printk("Last pivot in left is %lu\n", to->pivots[node_off - 1]);
printk("Switch to right\n");
- size = total_data - split;
+ size = mt_slots[right->type];
+ printk("size is %u\n", size);
to = right;
split = 255;
}
i++;
printk("node off is %u vs %u\n", node_off, src->end);
} while (node_off <= src->end);
+ printk("Last pivot in right is %lu\n", to->pivots[node_off - 1]);
return i;
}
*
* Returns: True on rebalance, false otherwise.
*/
+/* FIXME: full nodes need to create a new pivot */
static bool mas_wr_try_rebalance(struct ma_state *mas,
struct ma_node_info *src, unsigned char new_end,
struct ma_node_info *left, struct ma_node_info *right,
//printk("%d height is %d\n", __LINE__, height);
while (--height) {
- i = 0;
printk("===================Start of loop\n");
mas_wr_ascend_init(mas, &src_info);
+ printk("At %p\n", mas->node);
mas->end = src_info.end;
total = mas->end + 1;
if (mas->end + 1 < mt_slots[src_info.type])
left.min = src_info.min;
right.max = src_info.max;
+ printk("MIN %lu MAX %lu\n\n", left.min, right.max);
split = (total + 1) / 2;
+ printk("Split data at %u\n", split);
+ i = mt_wr_split_data(&src_info, &left, &right, &ma_part, split,
+ mas->offset, split, 0, wr_mas->offset_end,
+ total, state, 0);
+#if 0
if (split >= mas->offset) {
unsigned char space; /* size remaining in left */
mas->end - wr_mas->offset_end + 1);
}
}
+#endif
mns_assemble(state, i);
mni_finalise(&left);
mni_finalise(&right);
mni_node_part_init(&ma_part, &left, &right);
+ printk ("part size is %u\n", ma_part.size);
+ printk("part[1] = %lu\n", ma_part.pivots[1]);
printk("End of loop\n");
}