While sending the node to prune_tree(), we can also cleanup dead nodes
because we already hold the tree and node bucket write locks.
decrement_reference(rbtdb, node, 0, &nlocktype, &tlocktype,
true);
+ /*
+ * We have both write locks, we might as well do a light
+ * dead nodes cleaning.
+ */
+ cleanup_dead_nodes(rbtdb, locknum);
+
if (parent != NULL && parent->down == NULL) {
/*
* node was the only down child of the parent and has