From: Liam R. Howlett Date: Wed, 9 Dec 2020 22:00:22 +0000 (-0500) Subject: maple_tree: Only zero request_count in mas_pop_node() if needed X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bdcf7b15089a489933808600114d41510aece771;p=users%2Fjedix%2Flinux-maple.git maple_tree: Only zero request_count in mas_pop_node() if needed Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9369487497a6..8de0d2f574a7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -837,7 +837,7 @@ static inline struct maple_node *mas_pop_node(struct ma_state *mas) struct maple_alloc *ret, *node = mas->alloc; unsigned long total = mas_allocated(mas); - if (!total) // nothing or a request pending. + if (unlikely(!total)) // nothing or a request pending. return NULL; if (total == 1) { // single allocation in this ma_state @@ -861,9 +861,10 @@ single_node: new_head: ret->total = 0; ret->node_count = 0; - if (ret->request_count) + if (ret->request_count) { mas_set_alloc_req(mas, ret->request_count + 1); - ret->request_count = 0; + ret->request_count = 0; + } return (struct maple_node *)ret; } static inline void mas_push_node(struct ma_state *mas, struct maple_enode *used)