From: Liam R. Howlett Date: Fri, 23 May 2025 19:01:45 +0000 (-0400) Subject: max s issues X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3a6e1cc2d274a0e068ca7d6e19aeacbf715e22ce;p=users%2Fjedix%2Flinux-maple.git max s issues Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 46e110a7083e..b8a982aeacb9 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5072,8 +5072,10 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) */ /* Set up sources (up to 3) + part (always) */ sd.new_end = mas->end - part.skip + 1 + part.size; + max_s = 2; if (r_mas.node != mas->node) { sd.new_end += r_mas.end; + max_s++; } printk("\tAt %p and r_mas %p\n", mas_mn(mas), mas_mn(&r_mas)); @@ -5091,7 +5093,7 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) /* Take in more nodes */ printk("!!! %d min slots not met\n", __LINE__); if (r_parent.insert_off < r_parent.end) { - src[2] = &other; + src[++max_s] = &other; printk("%d: set src %u\n", __LINE__, 2); mas_next_node(&r_mas, r_parent.node, ULONG_MAX); r_parent.insert_off++; @@ -5109,7 +5111,7 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) printk("Looks like there is a left sibling\n"); } else if (r_parent.max > ULONG_MAX) { printk("%d: set src %u\n", __LINE__, 2); - src[2] = &other; + src[++max_s] = &other; mas_next_node(&r_mas, r_parent.node, ULONG_MAX); mni_mas_init(&other, &r_mas); r_parent.insert_off++; @@ -5190,7 +5192,6 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas) dst[d].max = src[s]->max; printk("max dst is %u\n", d); max_d = d; - max_s = s; s = d = 0; printk("START\n"); do {