From: Liam R. Howlett Date: Thu, 25 Sep 2025 03:10:09 +0000 (-0400) Subject: dst_setup(): Add fast path X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6cce53ef579853c96e8f07b865779799d37d9158;p=users%2Fjedix%2Flinux-maple.git dst_setup(): Add fast path If nodes will fit, the just go with it and fix the null terminated nodes in cp_data_write() Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1bf4e7524daf..4fbb38bfa4c0 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2589,7 +2589,10 @@ void dst_setup(struct maple_copy *cp, struct ma_state *mas, enum maple_type mt) cp->split = (cp->data - 1) / 2; cp->d_count = 2; - if (cp->data <= mt_slots[mt] * 2) { + if (cp->data < mt_slots[mt] * 2) + goto node_setup; + + if (cp->data == mt_slots[mt] * 2) { unsigned char off; unsigned char s;