Skip to content

Commit e852cb1

Browse files
RichardWeiYangakpm00
authored andcommitted
maple_tree: clear request_count for new allocated one
Patch series "maple_tree: simplify mas_push_node()", v2. When count is not 0, we know head is valid. So we can put the assignment in if (count) instead of checking the head pointer again. Also count represents current total, we can assign the new total by increasing the count by one. This patch (of 3): If this is not a new allocated one, the request_count has already been cleared in mas_set_alloc_req(). Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Cc: Sidhartha Kumar <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0cc8d68 commit e852cb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/maple_tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,11 +1265,11 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
12651265

12661266
mas->alloc = node;
12671267
node->total = ++allocated;
1268+
node->request_count = 0;
12681269
requested--;
12691270
}
12701271

12711272
node = mas->alloc;
1272-
node->request_count = 0;
12731273
while (requested) {
12741274
max_req = MAPLE_ALLOC_SLOTS - node->node_count;
12751275
slots = (void **)&node->slot[node->node_count];

0 commit comments

Comments
 (0)