]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
add comment to data_fits and reduce branching
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Sep 2025 14:22:43 +0000 (10:22 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Sep 2025 14:22:43 +0000 (10:22 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 62dda0474f1e76430e3bcd58738c8c1cd3963c09..80fc52d785f644e3e084048e794d5b0c1b85c09b 100644 (file)
@@ -2445,16 +2445,16 @@ static bool data_fits(struct ma_state *sib, struct ma_state *mas,
         * to end to convert the index to a size means that the below
         * calculation should be <=, but we want to keep an extra space in nodes
         * to reduce jitter.
+        *
+        * Note that it is still possible to get a full node on the left by the
+        * NULL landing exactly on the split.  The NULL ending of a node happens
+        * in the multi_dst_setup() function, where we will either increase the
+        * split by one or decrease it by one, if possible.  In the case of
+        * split (this case), it is always possible to shift the spilt by one -
+        * again because there is at least one slot free by the below checking.
         */
-
-
-       if (ma_is_leaf(type)) {
-               if (new_data < space)
-                       return true;
-       } else {
-               if (new_data < space)
-                       return true;
-       }
+       if (new_data < space)
+               return true;
 
        return false;
 }