From c6cbaef94ffde3f24643e2c9f907cb5463dd98a3 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Sat, 1 Dec 2018 17:28:32 -0500 Subject: [PATCH] maple_tree: Store plain node in ms->alloc The _maple_mk_node encoding is only for when nodes are inserted into the tree. Signed-off-by: Matthew Wilcox --- lib/maple_tree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 9ef8bd57d5a4..cccf7f8a18d7 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -93,12 +93,12 @@ static bool __maple_nomem(struct maple_state *ms, gfp_t gfp) { if (gfpflags_allow_blocking(gfp)) { spin_unlock(&ms->tree->lock); - ms->alloc = _maple_mk_node(_maple_new_node(gfp)); + ms->alloc = _maple_new_node(gfp); spin_lock(&ms->tree->lock); } else { - ms->alloc = _maple_mk_node(_maple_new_node(gfp)); + ms->alloc = _maple_new_node(gfp); } - if (ms->alloc == NULL) + if (!ms->alloc) return false; return true; } @@ -231,8 +231,8 @@ static struct maple_node *_maple_state_node(struct maple_state *ms) { struct maple_node *alt_mn; - if (ms->alloc != NULL) { - alt_mn = _maple_to_node(ms->alloc); + if (ms->alloc) { + alt_mn = ms->alloc; ms->alloc = NULL; } else { alt_mn = _maple_new_node(GFP_KERNEL | GFP_NOWAIT | -- 2.50.1