]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Add root expand to node if the single entry ends in 10.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 1 Feb 2019 00:28:50 +0000 (19:28 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 18:55:34 +0000 (14:55 -0400)
As requested by page cache.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 7625fcd967b5a9c526ee6962b2629c3d9330046b..d012855a23220f3b2402af85c73db6965a8d647b 100644 (file)
@@ -941,7 +941,12 @@ void ma_insert(struct ma_state *mas, void *entry)
                if (mas->last == 0) {
                        if (mas->node != NULL)
                                goto exists;
-                       rcu_assign_pointer(mas->tree->ma_root, entry);
+
+                       if (((unsigned long) (entry) & 3) == 2)
+                               ma_root_expand(mas, entry);
+                       else
+                               rcu_assign_pointer(mas->tree->ma_root, entry);
+
                        return;
                }
                ma_root_expand(mas, entry);