From e8940d2e3d31e739e1785492e89538c23ffbc08d Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 25 Jan 2019 15:49:28 -0500 Subject: [PATCH] maple_tree: Remove enc_full and just use mas->node. No need for this variable in mas_split. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 0e87a093f137..41488104a459 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -504,7 +504,6 @@ static void ma_link(struct maple_node *new, struct maple_node *parent, static int ma_split(struct ma_state *mas, unsigned char slot, unsigned char num, int depth) { - struct maple_node *enc_full = mas->node; // Encoded full node. struct maple_node *full = mt_to_node(mas->node); unsigned char split, p_slot = 0, p_end = 0; struct maple_node *old_parent, *new_parent, *left, *right; @@ -518,8 +517,8 @@ static int ma_split(struct ma_state *mas, unsigned char slot, p_end = ma_data_end_r64(&old_parent->mr64, UINT_MAX); if (p_end >= MAPLE_RANGE64_SLOTS - 1) { /* Must split the parent */ + p_slot = mt_parent_slot(mas->node); ma_encoded_parent(mas); - p_slot = mt_parent_slot(enc_full); split = ma_split(mas, p_slot, p_end, 1); if (mas_is_err(mas)) return 0; @@ -531,7 +530,6 @@ static int ma_split(struct ma_state *mas, unsigned char slot, } } - enc_full = mas->node; mas_node_cnt(mas, 3); if (mas_is_err(mas)) return 0; @@ -542,13 +540,13 @@ static int ma_split(struct ma_state *mas, unsigned char slot, new_parent = ma_next_alloc(mas); // Record the node type for the children types. - ctype = mt_node_type(enc_full); + ctype = mt_node_type(mas->node); // copy the data and calculate the split location. split = ma_cp_data_64(mas, left, right, 0); // Copy the parents information if (!ma_is_root(full)) { // Copy the parent data and leave a hole. - p_slot = mt_parent_slot(enc_full); + p_slot = mt_parent_slot(mas->node); MA_CP(cp, old_parent, new_parent, 0, p_slot); ma_copy(mas, &cp); cp.dst_start += 1; -- 2.50.1