From: Liam R. Howlett Date: Wed, 24 Jun 2020 00:10:56 +0000 (-0400) Subject: wip: Add height reset to destroy and debug output. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b7a5ee091e63377dea4d0429bd3b1ab42acde770;p=users%2Fjedix%2Flinux-maple.git wip: Add height reset to destroy and debug output. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 7e79a6aa395e..0081213c1a4f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4610,6 +4610,7 @@ void mtree_destroy(struct maple_tree *mt) mte_destroy_walk(destroyed, mt); mt->ma_flags = 0; + mt->ma_height = 0; rcu_assign_pointer(mt->ma_root, NULL); mtree_unlock(mt); } @@ -4798,8 +4799,8 @@ void mt_dump(const struct maple_tree *mt) { void *entry = mt->ma_root; - pr_info("maple_tree("MA_PTR") flags %X, root "MA_PTR"\n", - mt, mt->ma_flags, entry); + pr_info("maple_tree("MA_PTR") flags %X, height %u root "MA_PTR"\n", + mt, mt->ma_flags, mt->ma_height, entry); if (!xa_is_node(entry)) mt_dump_entry(entry, 0, 0, 0); else if (entry)