diff mbox series

[05/18] maple_tree: set store type in mas_store_prealloc()

Message ID 20240604174145.563900-6-sidhartha.kumar@oracle.com (mailing list archive)
State New
Headers show
Series Introduce a store type enum for the Maple tree | expand

Commit Message

Sidhartha Kumar June 4, 2024, 5:41 p.m. UTC
Set the store type in mas_store_prealloc(). This is needed as
mas_wr_store_entry() will be modified to read the store type to make a
decision about how to complete the store.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 lib/maple_tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Liam R. Howlett June 4, 2024, 7:27 p.m. UTC | #1
* Sidhartha Kumar <sidhartha.kumar@oracle.com> [240604 13:42]:
> Set the store type in mas_store_prealloc(). This is needed as
> mas_wr_store_entry() will be modified to read the store type to make a
> decision about how to complete the store.

You have two of these small patches, one has a different description
"set write store type" vs "set store type".  I think they both can be
combined into the mas_wr_store_entry() modification?  They are pretty
straight forward and the commit log can explain them.

> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---
>  lib/maple_tree.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index b37fa8690558..3780d4bb0415 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -5631,7 +5631,8 @@ void mas_store_prealloc(struct ma_state *mas, void *entry)
>  {
>  	MA_WR_STATE(wr_mas, mas, entry);
>  
> -	mas_wr_store_setup(&wr_mas);
> +	mas_wr_prealloc_setup(&wr_mas);
> +	mas_wr_store_type(&wr_mas);
>  	trace_ma_write(__func__, mas, 0, entry);
>  	mas_wr_store_entry(&wr_mas);
>  	MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas));
> -- 
> 2.45.1
>
diff mbox series

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index b37fa8690558..3780d4bb0415 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -5631,7 +5631,8 @@  void mas_store_prealloc(struct ma_state *mas, void *entry)
 {
 	MA_WR_STATE(wr_mas, mas, entry);
 
-	mas_wr_store_setup(&wr_mas);
+	mas_wr_prealloc_setup(&wr_mas);
+	mas_wr_store_type(&wr_mas);
 	trace_ma_write(__func__, mas, 0, entry);
 	mas_wr_store_entry(&wr_mas);
 	MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas));