From: Liam R. Howlett Date: Tue, 13 May 2025 14:41:04 +0000 (-0400) Subject: wip X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=03f6fa7a8f9bef418afd4449c2d184a18a77a7a6;p=users%2Fjedix%2Flinux-maple.git wip Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d19df086a238..8a59186f1640 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4978,7 +4978,7 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) printk("\nwr_mas %lu\n", mas->min); - printk("At %p and %p\n", mas_mn(mas), mas_mn(&r_mas)); + printk("At %p and r_mas %p\n", mas_mn(mas), mas_mn(&r_mas)); printk("r_mas: end piv is %lu max %lu\n", r_wr_mas.end_piv, r_mas.max); wr_mas->end_piv = r_wr_mas.end_piv; @@ -5126,9 +5126,12 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) s = d = 0; printk("START\n"); do { + unsigned char max = limits[d] + 1 - sd.offset; + printk("limits is %u/%u\n", limits[d], sd.offset); printk("pass dst %p\n", &dst[d]); - spanning_append(&sd, src[s], &dst[d], limits[d] + 1 - sd.offset); + spanning_append(&sd, src[s], &dst[d], max); + /* destination full */ if (sd.offset > limits[d]) { /* Check NULL.. */ if (ma_is_leaf(src[s]->type) @@ -5144,6 +5147,7 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) printk("dst ++\n"); } + /* Source exhausted */ if (src[s]->offset > src[s]->end) { src[s]->offset = 0; s++;