unsigned long bitmask = 0x7F;
return (void *)((unsigned long)(mte_to_node(node)->parent) & ~bitmask);
-
}
static inline bool mte_dead_node(const struct maple_enode *enode)
break;
}
}
+
/*
* mte_set_slot() - Set an encoded nodes rcu slot.
*/
dst->min = src->min;
mas_set_offset(dst, mas_offset(src));
}
+
/*
* mas_descend() - Descend into the slot stored in the ma_state.
*
return max_gap;
}
+
/*
* mas_max_gap() - find the largest gap in a non-leaf node and set the slot.
*/
slot = mte_parent_slot(gaps.node);
goto ascend;
}
+
/*
* mas_update_gap() - Update a nodes gaps and propagate up if necessary.
*
mas->node = MAS_NONE;
return mas->max;
}
+
/*
* mas_first_entry() - * Returns the pivot which points to the entry with the
* lowest index.
return false;
}
+
/*
* mab_no_null_split() - ensure the split doesn't fall on a NULL
*
}
b_node->b_end = j;
}
+
/*
* mab_mas_cp() - Copy data from maple_big_node to a maple encoded node.
*
return ma_enode_ptr(MAS_NONE);
}
+
/*
* mast_topiary() - Add the portions of the tree to the removal list; either to
* be freed or discarded (destroy walk).
mast_rebalance_prev(mast, old_l);
return true;
}
+
/*
* mast_ascend_free() - Add current original maple state nodes to the free list
* and ascend.
{
return mt_mk_node(ma_mnode_ptr(mas_next_alloc(mas)), b_node->type);
}
+
/*
* mas_mab_to_node() - Set up right and middle nodes
*
mas_mab_cp(mast->orig_l, 0, l_slot - 1, mast->bn, 0);
}
+
/*
* Copy in the original right side of the tree into the combined data set in
* the maple subtree state big node.
mas_set_err(mas, -EEXIST);
return 0;
}
+
/*
*
* mas_is_span_() - Set span_enode if there is no value already and the
else
mas->full_cnt--;
}
+
/*
*
* mas_wr_walk(): Walk the tree for a write. Tracks extra information which
return r_slot;
}
+
/*
*
* __mas_walk(): Locates a value and sets the mas->node and slot accordingly.
}
return ret;
}
+
/*
*
* mas_spanning_store() - Create a subtree with the store operation completed
no_entry:
mas->node = MAS_NONE;
}
+
/*
* Find the next non-null entry at the same level in the tree. The next value
* will be mas->node[mas_offset(mas)] or MAS_NONE.
mas_set_offset(mas, slot);
return true;
}
+
/*
* mas_next_nentry() - Next node entry. Set the @mas slot to the next valid
* entry and range_start to the start value for that entry. If there is no
mas_set_offset(mas, slot);
return true;
}
+
/*
*
* Returns the pivot which points to the entry with the highest index.
last = mas->node;
}
}
+
/* Skip this slot in the parent. */
static inline bool mas_skip_node(struct ma_state *mas)
{
{
return _mas_get_empty_area(mas, min, max, size, false);
}
+
/*
* mas_alloc() - Allocate a range.
*
no_gap:
return -EBUSY;
}
+
/*
* mas_rev_alloc() - Reverse allocate a range.
*
}
}
+
/* mas limits not adjusted */
static inline void mas_dfs_preorder(struct ma_state *mas)
{
}
return slots;
}
+
/*
* mte_destroy_walk() - Free the sub-tree from @mn and below.
*
else
mt_destroy_walk(&node->rcu);
}
+
/* Interface */
void __init maple_tree_init(void)
{
mas->max = p_max;
mas->min = p_min;
}
+
/*
* validate a maple tree by checking:
* 1. The limits (pivots are within mas->min to mas->max)