diff mbox series

[1/4] maple_tree: clear request_count for new allocated one

Message ID 20240924123954.18933-2-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series cleanup maple_alloc related functions | expand

Commit Message

Wei Yang Sept. 24, 2024, 12:39 p.m. UTC
If this is not a new allocated one, the request_count has already been
cleared in mas_set_alloc_req().

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Liam R. Howlett <Liam.Howlett@Oracle.com>
CC: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 lib/maple_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Liam R. Howlett Oct. 15, 2024, 1:18 a.m. UTC | #1
* Wei Yang <richard.weiyang@gmail.com> [240924 08:41]:
> If this is not a new allocated one, the request_count has already been
> cleared in mas_set_alloc_req().
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> CC: Liam R. Howlett <Liam.Howlett@Oracle.com>
> CC: Sidhartha Kumar <sidhartha.kumar@oracle.com>

Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>

> ---
>  lib/maple_tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index fab1610dc800..75be2c81f0e2 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -1250,11 +1250,11 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
>  
>  		mas->alloc = node;
>  		node->total = ++allocated;
> +		node->request_count = 0;
>  		requested--;
>  	}
>  
>  	node = mas->alloc;
> -	node->request_count = 0;
>  	while (requested) {
>  		max_req = MAPLE_ALLOC_SLOTS - node->node_count;
>  		slots = (void **)&node->slot[node->node_count];
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index fab1610dc800..75be2c81f0e2 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1250,11 +1250,11 @@  static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
 
 		mas->alloc = node;
 		node->total = ++allocated;
+		node->request_count = 0;
 		requested--;
 	}
 
 	node = mas->alloc;
-	node->request_count = 0;
 	while (requested) {
 		max_req = MAPLE_ALLOC_SLOTS - node->node_count;
 		slots = (void **)&node->slot[node->node_count];