From: Liam R. Howlett Date: Tue, 16 Sep 2025 17:56:12 +0000 (-0400) Subject: rename rebalance_dest to multi_dst X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9965da65f3f3889caeb0c51f5542df37a478e6fe;p=users%2Fjedix%2Flinux-maple.git rename rebalance_dest to multi_dst Signed-off-by: Liam R. Howlett --- diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index eb8f55d139b8..0ac78e27b02f 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -163,6 +163,12 @@ enum store_type { }; struct maple_copy { + /* + * min, max, and pivots are values + * start, end, split are indexes into arrays + * data is a size + */ + struct { struct maple_node *node; unsigned long max; diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1720fbe5977e..28f053a06288 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3113,7 +3113,7 @@ static inline void spanning_data_calc(struct maple_copy *cp, } static inline -void rebalance_dest_setup(struct maple_copy *cp, struct ma_state *mas, +void multi_dst_setup(struct maple_copy *cp, struct ma_state *mas, enum maple_type mt) { /* Data is 1 indexed, every src has +1 added. */ @@ -3366,7 +3366,7 @@ static inline void rebalance_new_root(struct maple_copy *cp, struct ma_state *ma cp->data = cp->d_count; cp->s_count = 0; - rebalance_dest_setup(cp, mas, mt); + multi_dst_setup(cp, mas, mt); spanning_init_cp_src(cp); node_copy(mas, cp->src[0].node, 0, cp->data, cp->max, maple_copy, cp->dst[0].node, 0, mt); @@ -3438,7 +3438,7 @@ static void mas_wr_spanning_rebalance(struct ma_state *mas, do { spanning_data_calc(&cp, l_wr_mas, r_wr_mas, &sib); multi_src_setup(&cp, l_wr_mas, r_wr_mas, &sib); - rebalance_dest_setup(&cp, mas, l_wr_mas->type); + multi_dst_setup(&cp, mas, l_wr_mas->type); cp_data_write(&cp, mas); } while (spanning_ascend(&cp, mas, l_wr_mas, r_wr_mas, &sib)); @@ -4508,6 +4508,15 @@ static inline void mas_wr_append(struct ma_wr_state *wr_mas, */ static noinline_for_kasan void mas_wr_split(struct ma_wr_state *wr_mas) { +#if 1 + struct maple_enode *old_enode; + struct ma_state *mas; + struct maple_copy cp; + struct ma_state sib; + + trace_ma_write(__func__, wr_mas->mas, 0, wr_mas->entry); + +#else struct maple_big_node b_node; trace_ma_write(__func__, wr_mas->mas, 0, wr_mas->entry); @@ -4515,6 +4524,7 @@ static noinline_for_kasan void mas_wr_split(struct ma_wr_state *wr_mas) mas_store_b_node(wr_mas, &b_node, wr_mas->offset_end); WARN_ON_ONCE(wr_mas->mas->store_type != wr_split_store); return mas_split(wr_mas->mas, &b_node); +#endif } /* @@ -4551,7 +4561,7 @@ static void mas_wr_rebalance(struct ma_wr_state *wr_mas) do { rebalance_data_calc(&cp, wr_mas, &sib); multi_src_setup(&cp, wr_mas, wr_mas, &sib); - rebalance_dest_setup(&cp, mas, wr_mas->type); + multi_dst_setup(&cp, mas, wr_mas->type); cp_data_write(&cp, mas); } while (rebalance_ascend(&cp, wr_mas, &sib));