]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Store plain node in ms->alloc
authorMatthew Wilcox <willy@infradead.org>
Sat, 1 Dec 2018 22:28:32 +0000 (17:28 -0500)
committerMatthew Wilcox <willy@infradead.org>
Sat, 1 Dec 2018 22:28:32 +0000 (17:28 -0500)
The _maple_mk_node encoding is only for when nodes are inserted into
the tree.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/maple_tree.c

index 9ef8bd57d5a45c6d58971f0a3938120e7a5cedb1..cccf7f8a18d761bfb60f0846492d17dc46cd667d 100644 (file)
@@ -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 |