From 7ec1b0451f128246a2c2a9b6a406e7243cd6fd12 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 17 Jul 2020 17:22:55 -0400 Subject: [PATCH] maple_tree: Cleaning Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index dfa44dc35bb8..d0df92d408b8 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1684,7 +1684,6 @@ static inline unsigned char mas_store_b_node(struct ma_state *mas, b_node->pivot[b_end] = mas->last; piv = mas_get_safe_pivot(mas, slot); - if (piv > mas->last) { b_node->slot[++b_end] = contents; b_node->pivot[b_end] = piv; @@ -2900,7 +2899,7 @@ static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite return NULL; // spanning writes always overwrite something. } ret = mas_spanning_store(mas, entry); - goto done; + goto exists; } /* At this point, we are at the leaf node that needs to be altered. */ @@ -2910,7 +2909,7 @@ static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite content = mas_get_rcu_slot(mas, slot); if (!overwrite && ((mas->last > r_max) || content )) { mas_set_err(mas, -EEXIST); - goto done; + goto exists; } if (!entry) { @@ -2922,6 +2921,7 @@ static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite mas_set_slot(mas, slot); b_node.b_end = mas_store_b_node(mas, &b_node, entry); b_node.min = mas->min; + b_node.type = mte_node_type(mas->node); // Check if this is an append operation. end = mas_data_end(mas); @@ -2931,26 +2931,26 @@ static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite mte_set_rcu_slot(mas->node, slot, entry); mte_set_pivot(mas->node, slot, mas->last); - goto done; + goto append; } // count the node as full if it has not already been counted. if (b_node.b_end >= slot_cnt && end < slot_cnt) mas_cnt_full(mas); else if (b_node.b_end < mt_min_slot_cnt(mas->node)) - mas_cnt_empty(mas); + mas_cnt_empty(mas); - b_node.type = mte_node_type(mas->node); mas_commit_b_node(mas, &b_node); if (mas_is_err(mas)) ret = 3; -done: if (mas_is_err(mas)) return NULL; if (ret > 2) return NULL; +append: +exists: return content; } -- 2.50.1