]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Remove mt_is_advanced in favor of xa_is_advanced.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 20 May 2020 17:22:16 +0000 (13:22 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:04:52 +0000 (15:04 -0400)
The two functions are now the same so just use the xa_ version.

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

index bd9ff56933c36d4927c01b5005ba887a2c67d71b..e2707cc6610b02f37697466ff34d95ca6bb7d465 100644 (file)
@@ -153,11 +153,6 @@ static inline bool mt_is_reserved(const void *entry)
        return ((unsigned long)entry < 4096) && xa_is_internal(entry);
 }
 
-static inline bool mt_is_advanced(const void *entry)
-{
-       return xa_is_internal(entry) && (entry < XA_ZERO_ENTRY);
-}
-
 static inline bool mt_is_empty(const void *entry)
 {
        return (!entry) || xa_is_deleted(entry) || xa_is_skip(entry);
@@ -949,7 +944,7 @@ static inline void mas_shift_pivot(struct ma_state *curr,
                                        if (!leaf) {
                                                if (mt_is_alloc(left.tree))
                                                        mte_set_gap(left.node, slot, 0);
-                                               if (!mt_is_advanced(entry))
+                                               if (!xa_is_advanced(entry))
                                                        mte_free(entry); // Destroy not needed.
                                        }
                                } while (--slot > l_p_slot);
@@ -964,7 +959,7 @@ static inline void mas_shift_pivot(struct ma_state *curr,
                                if (!leaf ) {
                                        if (mt_is_alloc(right.tree))
                                                mte_set_gap(right.node, r_p_slot, 0);
-                                       if (!mt_is_advanced(entry))
+                                       if (!xa_is_advanced(entry))
                                                mte_free(entry);
                                }
                        }
@@ -985,7 +980,7 @@ static inline void mas_shift_pivot(struct ma_state *curr,
                                if (!leaf ) {
                                        if (mt_is_alloc(left.tree))
                                                mte_set_gap(left.node, l_p_slot, 0);
-                                       if (!mt_is_advanced(entry))
+                                       if (!xa_is_advanced(entry))
                                                mte_free(entry);
                                }
 
@@ -5312,7 +5307,7 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index,
 {
        MA_STATE(mas, mt, index, last);
 
-       if (WARN_ON_ONCE(mt_is_advanced(entry)))
+       if (WARN_ON_ONCE(xa_is_advanced(entry)))
                return -EINVAL;
 
        if (index > last)
@@ -5344,7 +5339,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first,
 {
        MA_STATE(ms, mt, first, last);
 
-       if (WARN_ON_ONCE(mt_is_advanced(entry)))
+       if (WARN_ON_ONCE(xa_is_advanced(entry)))
                return -EINVAL;
 
        if (first > last)