Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/20241015120746.15850-1-richard.weiyang@gmail.com
Link: https://lkml.kernel.org/r/20241015120746.15850-2-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Wei Yang and committed by
Andrew Morton
e852cb1d 0cc8d68a

+1 -1
+1 -1
lib/maple_tree.c
··· 1265 1265 1266 1266 mas->alloc = node; 1267 1267 node->total = ++allocated; 1268 + node->request_count = 0; 1268 1269 requested--; 1269 1270 } 1270 1271 1271 1272 node = mas->alloc; 1272 - node->request_count = 0; 1273 1273 while (requested) { 1274 1274 max_req = MAPLE_ALLOC_SLOTS - node->node_count; 1275 1275 slots = (void **)&node->slot[node->node_count];