]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: introduce store_type enum
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Fri, 13 Oct 2023 19:17:56 +0000 (12:17 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Sat, 20 Apr 2024 01:40:08 +0000 (21:40 -0400)
Add a store_type enum that is stored in ma_state. This will be used to
keep track of partial walks of the tree so that subsequent walks can
pick up where a previous walk left off.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
include/linux/maple_tree.h

index b3d63123b945b58bc7549142d79fd2783f2b0f07..359dcde426293b53f7c23b1a11b28134efd86898 100644 (file)
@@ -148,6 +148,19 @@ enum maple_type {
        maple_arange_64,
 };
 
+enum store_type {
+       wr_invalid,
+       wr_new_root,
+       wr_store_root,
+       wr_exact_fit,
+       wr_spanning_store,
+       wr_split_store,
+       wr_rebalance,
+       wr_append,
+       wr_node_store,
+       wr_slot_store,
+       wr_bnode
+};
 
 /**
  * DOC: Maple tree flags
@@ -432,6 +445,7 @@ struct ma_state {
        unsigned char offset;
        unsigned char mas_flags;
        unsigned char end;              /* The end of the node */
+       enum store_type store_type;     /* The type of store needed for this operation */
 };
 
 struct ma_wr_state {
@@ -473,6 +487,7 @@ struct ma_wr_state {
                .max = ULONG_MAX,                                       \
                .alloc = NULL,                                          \
                .mas_flags = 0,                                         \
+               .store_type = wr_invalid,                               \
        }
 
 #define MA_WR_STATE(name, ma_state, wr_entry)                          \