]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Rename ms_root_expand to mas_root_expand to align with naming convention
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 15 Oct 2019 18:44:00 +0000 (14:44 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 15 Oct 2019 18:44:00 +0000 (14:44 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 3f2dc1b1d4f261be7523c768931b970e04c463df..8c12ed33672ede98b242aeb79986c665e9074bdc 100644 (file)
@@ -2142,47 +2142,47 @@ static inline int _ma_store(struct ma_state *mas, void *entry,
        return _mas_add(mas, entry, true, true);
 }
 
-static inline void ma_root_expand(struct ma_state *ms, void *entry)
+static inline void mas_root_expand(struct ma_state *mas, void *entry)
 {
-       void *r_entry = rcu_dereference(ms->tree->ma_root);  // root entry
+       void *r_entry = rcu_dereference(mas->tree->ma_root);  // root entry
        struct maple_node *mn;
-       enum maple_type mt = mas_ptype_leaf(ms);
+       enum maple_type mt = mas_ptype_leaf(mas);
        int slot = 0;
 
-       mas_node_cnt(ms, 1);
-       if (mas_is_err(ms))
+       mas_node_cnt(mas, 1);
+       if (mas_is_err(mas))
                return;
 
-       mn = mas_next_alloc(ms);
-       ms->node = mt_mk_node(mn, mt);
+       mn = mas_next_alloc(mas);
+       mas->node = mt_mk_node(mn, mt);
        mn->parent = ma_parent_ptr(
-                     ((unsigned long)ms->tree | MA_ROOT_PARENT));
+                     ((unsigned long)mas->tree | MA_ROOT_PARENT));
 
-       if (ms->index != 0) {
+       if (mas->index != 0) {
                slot++;
                /* Assign the old entry to slot 0, or set it to null. */
-               mte_set_rcu_slot(ms->node, 0, r_entry);
+               mte_set_rcu_slot(mas->node, 0, r_entry);
                if (!r_entry)
-                       mte_set_pivot(ms->node, 0, ms->index - 1);
+                       mte_set_pivot(mas->node, 0, mas->index - 1);
        }
        // FIXME: When task_size / page_size -1 works, check to ensure we are
        // not inserting above this.
-       _mas_insert(ms, entry, slot);
+       _mas_insert(mas, entry, slot);
 
-       if (mas_is_err(ms))
+       if (mas_is_err(mas))
                return;
 
-       if (mt_is_alloc(ms->tree)) {
-               // FIXME: ms->index = TASK_SIZE / PAGE_SIZE - 1;
-               ms->index = 0x2000000000000UL;
-               ms->last = mt_max[mt];
-               _mas_insert(ms, XA_ZERO_ENTRY, 2);
-               if (mas_is_err(ms))
+       if (mt_is_alloc(mas->tree)) {
+               // FIXME: mas->index = TASK_SIZE / PAGE_SIZE - 1;
+               mas->index = 0x2000000000000UL;
+               mas->last = mt_max[mt];
+               _mas_insert(mas, XA_ZERO_ENTRY, 2);
+               if (mas_is_err(mas))
                        return;
        }
 
        /* swap the new root into the tree */
-       rcu_assign_pointer(ms->tree->ma_root, mte_mk_root(ms->node));
+       rcu_assign_pointer(mas->tree->ma_root, mte_mk_root(mas->node));
 }
 
 static inline int mas_safe_slot(struct ma_state *mas, unsigned char *slot,
@@ -3800,9 +3800,9 @@ static inline int ma_root_ptr(struct ma_state *mas, void *entry,
                        goto exists;
 
        if (mas->last != 0)
-               ma_root_expand(mas, entry);
+               mas_root_expand(mas, entry);
        else if (((unsigned long) (entry) & 3) == 2)
-               ma_root_expand(mas, entry);
+               mas_root_expand(mas, entry);
        else
                rcu_assign_pointer(mas->tree->ma_root, entry);
        return 1;
@@ -3888,7 +3888,7 @@ static inline int ma_alloc(struct ma_state *mas, void *entry,
        mas_start(mas);
 
        if (mas_is_none(mas) || mas_is_ptr(mas)) {
-               ma_root_expand(mas, entry);
+               mas_root_expand(mas, entry);
                if (mas_is_err(mas))
                        return xa_err(mas->node);
 
@@ -3942,7 +3942,7 @@ static inline int ma_rev_alloc(struct ma_state *mas, void *entry,
        }
 
        if (mas_is_ptr(mas)) {
-               ma_root_expand(mas, entry);
+               mas_root_expand(mas, entry);
                if (!mas->index)
                        return mte_get_pivot(mas->node, 0);
                return mte_get_pivot(mas->node, 1);