return true;
}
-static void mas_wr_spanning_rebalance(struct ma_state *mas,
- struct ma_wr_state *l_wr_mas, struct ma_wr_state *r_wr_mas)
-{
- struct maple_enode *old_enode;
- struct maple_copy cp;
- struct ma_state sib;
-
- /*
- * Spanning store is different in that the write is actually from
- * l_mas->index to r_mas->last - 1. The -1 is because the last
- * was incremented to get to the next node in the case of NULL entries
- * being stored to the last slot of the left node.
- */
-
- cp_leaf_init(&cp, mas, l_wr_mas, r_wr_mas);
- do {
- spanning_data(&cp, l_wr_mas, r_wr_mas, &sib);
- multi_src_setup(&cp, l_wr_mas, r_wr_mas, &sib);
- dst_setup(&cp, mas, l_wr_mas->type);
- cp_data_write(&cp, mas);
- } while (spanning_ascend(&cp, mas, l_wr_mas, r_wr_mas, &sib));
-
- old_enode = mas->node;
- mas->node = cp.slot[0];
- mas_wmb_replace(mas, old_enode, cp.height);
- mtree_range_walk(mas);
-}
-
/*
* rebalance_ascend() - Ascend the tree and set up for the next loop - if
* necessary
mas_wr_walk_traverse(wr_mas);
}
}
+
/*
* mas_extend_spanning_null() - Extend a store of a %NULL to include surrounding %NULLs.
* @l_wr_mas: The left maple write state
*/
static void mas_wr_spanning_store(struct ma_wr_state *wr_mas)
{
+ struct maple_enode *old_enode;
+ struct maple_copy cp;
struct ma_state *mas;
+ struct ma_state sib;
/* Left and Right side of spanning store */
MA_STATE(r_mas, NULL, 0, 0);
return mas_new_root(mas, wr_mas->entry);
}
- mas_wr_spanning_rebalance(mas, wr_mas, &r_wr_mas);
+
+ /*
+ * Spanning store is different in that the write is actually from
+ * l_mas->index to r_mas->last - 1. The -1 is because the last
+ * was incremented to get to the next node in the case of NULL entries
+ * being stored to the last slot of the left node.
+ */
+
+ cp_leaf_init(&cp, mas, wr_mas, &r_wr_mas);
+ do {
+ spanning_data(&cp, wr_mas, &r_wr_mas, &sib);
+ multi_src_setup(&cp, wr_mas, &r_wr_mas, &sib);
+ dst_setup(&cp, mas, wr_mas->type);
+ cp_data_write(&cp, mas);
+ } while (spanning_ascend(&cp, mas, wr_mas, &r_wr_mas, &sib));
+
+ old_enode = mas->node;
+ mas->node = cp.slot[0];
+ mas_wmb_replace(mas, old_enode, cp.height);
+ mtree_range_walk(mas);
}
/*