]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
max s issues
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 23 May 2025 19:01:45 +0000 (15:01 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 23 May 2025 19:01:58 +0000 (15:01 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 46e110a7083e6384378095d08cbc8a0db2f6d56a..b8a982aeacb90cab4d82a2189bae65bc6f437271 100644 (file)
@@ -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 {