Commit 025f9310 authored by Pedro Falcato's avatar Pedro Falcato Committed by Vlastimil Babka
Browse files

maple_tree: Replace mt_free_one() with kfree()



kfree() is a little shorter and works with kmem_cache_alloc'd pointers
too. Also lets us remove one more helper.

Signed-off-by: default avatarPedro Falcato <pfalcato@suse.de>
Reviewed-by: default avatarSuren Baghdasaryan <surenb@google.com>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent 9b60811c
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -177,11 +177,6 @@ static inline int mt_alloc_bulk(gfp_t gfp, size_t size, void **nodes)
	return kmem_cache_alloc_bulk(maple_node_cache, gfp, size, nodes);
}

static inline void mt_free_one(struct maple_node *node)
{
	kmem_cache_free(maple_node_cache, node);
}

static inline void mt_free_bulk(size_t size, void __rcu **nodes)
{
	kmem_cache_free_bulk(maple_node_cache, size, (void **)nodes);
@@ -5092,7 +5087,7 @@ static void mt_free_walk(struct rcu_head *head)
	mt_free_bulk(node->slot_len, slots);

free_leaf:
	mt_free_one(node);
	kfree(node);
}

static inline void __rcu **mte_destroy_descend(struct maple_enode **enode,
@@ -5176,7 +5171,7 @@ static void mt_destroy_walk(struct maple_enode *enode, struct maple_tree *mt,

free_leaf:
	if (free)
		mt_free_one(node);
		kfree(node);
	else
		mt_clear_meta(mt, node, node->type);
}
@@ -5385,7 +5380,7 @@ void mas_destroy(struct ma_state *mas)
			mt_free_bulk(count, (void __rcu **)&node->slot[1]);
			total -= count;
		}
		mt_free_one(ma_mnode_ptr(node));
		kfree(ma_mnode_ptr(node));
		total--;
	}

@@ -6373,7 +6368,7 @@ static void mas_dup_free(struct ma_state *mas)
	}

	node = mte_to_node(mas->node);
	mt_free_one(node);
	kfree(node);
}

/*