Reduce possible calls to get an rcu entry.
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
return ret;
}
+/*
+ * Private: Returns true if mas->node is a leaf
+ */
static inline bool _mas_walk(struct ma_state *mas)
{
enum maple_type type;
void *entry = NULL;
unsigned char slot = MAPLE_NODE_SLOTS;
bool leaf = false;
+ void *root = rcu_dereference(mas->tree->ma_root);
- if (rcu_dereference(mas->tree->ma_root) == NULL)
+ if (root == NULL)
return NULL;
- if (!xa_is_node(mas->tree->ma_root)) {
+ if (!xa_is_node(root)) {
if (mas->last == 0)
- return rcu_dereference(mas->tree->ma_root);
+ return root;
return NULL;
}