]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Don't pass contents to expand_root()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 10 Dec 2020 17:16:54 +0000 (12:16 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Jan 2021 17:33:37 +0000 (12:33 -0500)
it's not used

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 5bd61cd196e26cf03bfb735694b99b14ef95eb90..7454c42b8bd4784649fc89d79228d4a3d5efd1e8 100644 (file)
@@ -2917,15 +2917,15 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry)
 
 
        mas_node_count(mas, 1);
-       if (mas_is_err(mas))
+       if (unlikely(mas_is_err(mas)))
                return 0;
 
        node = mas_pop_node(mas);
        pivots = ma_pivots(node, type);
        slots = ma_slots(node, type);
-       mas->node = mt_mk_node(node, type);
-       mas_mn(mas)->parent = ma_parent_ptr(
+       node->parent = ma_parent_ptr(
                      ((unsigned long)mas->tree | MA_ROOT_PARENT));
+       mas->node = mt_mk_node(node, type);
 
        if (contents)
                slots[slot++] = contents;
@@ -2937,15 +2937,14 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry)
 
        slots[slot] = entry;
        pivots[slot++] = mas->last;
-       /* swap the new root into the tree */
-       rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node));
        mas->depth = 1;
        mas_set_height(mas);
+       /* swap the new root into the tree */
+       rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node));
        return slot;
 }
 
-static inline int ma_root_ptr(struct ma_state *mas, void *entry,
-               void *contents, bool overwrite)
+static inline int ma_root_ptr(struct ma_state *mas, void *entry, bool overwrite)
 {
        int ret = 1;
 
@@ -2953,12 +2952,9 @@ static inline int ma_root_ptr(struct ma_state *mas, void *entry,
                return 0;
 
        if (mas_root(mas) && mas->last == 0) {
-               contents = mas_root_locked(mas);
                if (!overwrite)
                        goto exists;
-       } else {
-               contents = NULL;
-       }
+       } else
 
        if (mas->last != 0)
                ret = mas_root_expand(mas, entry);
@@ -3476,7 +3472,7 @@ static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite
 
 
        if (mas_start(mas) || mas_is_none(mas) || mas->node == MAS_ROOT) {
-               ret = ma_root_ptr(mas, entry, content, overwrite);
+               ret = ma_root_ptr(mas, entry, overwrite);
                if (mas_is_err(mas))
                        return NULL;
                if (ret)