From: Liam R. Howlett Date: Fri, 1 Feb 2019 00:28:50 +0000 (-0500) Subject: maple_tree: Add root expand to node if the single entry ends in 10. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5c6087b884d4f954b248881d90ce4fe0bad1cd63;p=users%2Fjedix%2Flinux-maple.git maple_tree: Add root expand to node if the single entry ends in 10. As requested by page cache. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7625fcd967b5..d012855a2322 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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);