{
return ma_is_dense(mte_node_type(entry));
}
+
static inline bool ma_is_leaf(const enum maple_type type)
{
return type < maple_range_16;
{
return !entry;
}
+
static inline void mas_set_err(struct ma_state *mas, long err)
{
mas->node = MA_ERROR(err);
}
+
static inline bool mas_is_ptr(struct ma_state *mas)
{
return mas->node == MAS_ROOT;
}
+
static inline bool mas_is_start(struct ma_state *mas)
{
return mas->node == MAS_START;
return true;
}
+
static inline struct maple_node *mte_to_node(const struct maple_enode *entry)
{
return (struct maple_node *)((unsigned long)entry & ~127);
}
+
static inline struct maple_topiary *mte_to_mat(const struct maple_enode *entry)
{
return (struct maple_topiary *)((unsigned long)entry & ~127);
}
+
static inline struct maple_node *mas_mn(const struct ma_state *mas)
{
return mte_to_node(mas->node);
{
mte_to_node(mn)->parent = ma_parent_ptr(mte_to_node(mn));
}
+
static inline void mte_free(struct maple_enode *enode)
{
ma_free_rcu(mte_to_node(enode));
{
return (void *)((unsigned long)node | 2);
}
+
static inline void *mte_safe_root(const struct maple_enode *node)
{
return (void *)((unsigned long)node & ~2);
return 0;
}
}
+
static inline unsigned long _mte_get_pivot(const struct maple_enode *mn,
unsigned char slot, enum maple_type type)
{
return ma_get_pivot(mte_to_node(mn), slot, type);
}
+
static inline unsigned long mte_get_pivot(const struct maple_enode *mn,
unsigned char slot)
{
return _mte_get_pivot(mn, slot, mte_node_type(mn));
}
+
static inline unsigned long _mas_get_safe_pivot(const struct ma_state *mas,
unsigned char slot, enum maple_type type)
{
break;
}
}
+
static inline void mte_set_pivot(struct maple_enode *mn, unsigned char slot,
unsigned long val)
{
return mn->mr32.slot;
}
}
+
static inline struct maple_enode *ma_get_rcu_slot(
const struct maple_node *mn, unsigned char slot,
enum maple_type type, struct maple_tree *mtree)
{
return ma_get_rcu_slot(mte_to_node(mn), slot, type, mtree);
}
+
static inline struct maple_enode *mte_get_rcu_slot(const struct maple_enode *mn,
unsigned char slot, struct maple_tree *mtree)
{
return 0;
}
}
+
static inline unsigned long mte_get_gap(const struct maple_enode *mn,
unsigned char gap)
{
return mn;
}
+
static inline void mas_push_node(struct ma_state *mas, struct maple_enode *used)
{
struct maple_node *reuse = mte_to_node(used);
BUG_ON(!mas_get_alloc_cnt(mas));
}
+
static inline void mas_node_node(struct ma_state *ms, gfp_t gfp)
{
struct maple_node *mn, *smn;
mas->node = MAS_START;
return true;
}
+
static inline struct maple_node *mas_node_cnt(struct ma_state *mas, int count)
{
int allocated = mas_get_alloc_cnt(mas);
return max_gap;
}
+
static inline unsigned long mas_find_gap(struct ma_state *mas)
{
if (mte_is_leaf(mas->node))
mast->bn->b_end = end + 1 + b_end;
mas_set_offset(mast->l, mas_offset(mast->l) + end + 1);
}
+
static inline bool mast_sibling_rebalance_left(struct maple_subtree_state *mast)
{
struct maple_enode *old_r = mast->orig_r->node;
// Set right parent.
mas_set_split_parent(mast->r, l, r, &slot, split);
}
+
static inline void mas_wmb_replace(struct ma_state *mas,
struct ma_topiary *free,
struct ma_topiary *destroy)
mas_update_gap(mas);
}
+
static inline void mast_new_root(struct maple_subtree_state *mast,
struct ma_state *mas)
{
return false;
}
+
static inline bool mast_overflow(struct maple_subtree_state *mast)
{
if (mast->bn->b_end >= mt_slot_count(mast->orig_l->node))
mas_wmb_replace(mas, &free, &destroy);
return mast->bn->b_end;
}
+
static inline int mas_cnt_positive(struct ma_state *mas)
{
if (mas->full_cnt < 0)
return _mas_split_final_node(mast, mas, height);
}
+
static inline void mast_split_fill_bnode(struct maple_subtree_state *mast,
struct ma_state *mas,
unsigned char skip)
mas_wmb_replace(mas, mast.free, NULL);
return 1;
}
+
static inline bool mas_reuse_node(struct ma_state *mas,
struct maple_big_node *bn,
unsigned char end)
return true;
}
+
static inline int mas_commit_b_node(struct ma_state *mas,
struct maple_big_node *b_node,
unsigned char end)
mas_set_height(mas);
return slot;
}
+
static inline int ma_root_ptr(struct ma_state *mas, void *entry,
void *contents, bool overwrite)
{
mas_set_offset(mas, i);
return ret;
}
+
static inline void mas_cnt_full(struct ma_state *mas)
{
if (mas->full_cnt < 0)
else
mas->full_cnt++;
}
+
static inline void mas_cnt_empty(struct ma_state *mas)
{
if (mas->full_cnt > 0)
return false;
}
+
static inline void *_mas_store(struct ma_state *mas, void *entry, bool overwrite)
{
unsigned long r_max, r_min;
exists:
return content;
}
+
void *mas_store(struct ma_state *mas, void *entry)
{
if (mas->index <= mas->last)
return NULL;
}
+
static inline int mas_dead_node(struct ma_state *mas, unsigned long index);
/*
* mas_prev_node() - Find the prev non-null entry at the same level in the
mas_set_offset(mas, --slot);
return true;
}
+
static inline void mas_rev_awalk(struct ma_state *mas, unsigned long size)
{
struct maple_enode *last = NULL;
mas->max = mte_get_pivot(mas->node, slot);
return true;
}
+
static inline void mas_awalk(struct ma_state *mas, unsigned long size)
{
struct maple_enode *last = NULL;
mas->index = min;
mas->last = mas->index + size - 1;
}
+
void mas_set_rev_index(struct ma_state *mas, unsigned long size)
{
unsigned long gap_max = mas->max; // in-tree gap.
mas->last = gap_max;
mas->index = mas->last - size + 1;
}
+
static void _mas_empty_or_single_empty_area(struct ma_state *mas,
unsigned long min, unsigned long max, unsigned long size,
bool fwd)
mas->index = max;
}
+
static inline int _mas_get_empty_area(struct ma_state *mas,
unsigned long min, unsigned long max,
unsigned long size, bool forward)
{
return _mas_get_empty_area(mas, min, max, size, true);
}
+
int mas_get_empty_area_rev(struct ma_state *mas, unsigned long min,
unsigned long max, unsigned long size)
{
return entry;
}
+
void *mt_find(struct maple_tree *mt, unsigned long *index, unsigned long max)
{
return _mt_find(mt, index, max, true);
memcpy(node, mas_mn(oldmas), sizeof(struct maple_node));
return mt_mk_node(node, mte_node_type(oldmas->node));
}
+
static inline void mas_dup_alloc(struct ma_state *mas, int *node_cnt)
{
mas_adopt_children(mas, mas->node);
}
}
+
void _mas_dup_tree(struct ma_state *oldmas, struct ma_state *mas, int *node_cnt)
{
if (!xa_is_node(oldmas->tree->ma_root)) {
mas_adopt_children(mas, mas->node);
}
}
+
void mas_dup_tree(struct ma_state *oldmas, struct ma_state *mas)
{
int node_cnt = 0;
sizeof(struct maple_node), sizeof(struct maple_node),
SLAB_PANIC, NULL);
}
+
void mtree_init(struct maple_tree *mt, unsigned int ma_flags)
{
spin_lock_init(&mt->ma_lock);
mtree_unlock(mas.tree);
return ret;
}
+
int mtree_alloc_rrange(struct maple_tree *mt, unsigned long *startp,
void *entry, unsigned long size, unsigned long min,
unsigned long max, gfp_t gfp)