dm btree: use pop_frame in dm_btree_del to cleanup code
authorJoe Thornber <ejt@redhat.com>
Fri, 9 Aug 2013 11:48:42 +0000 (12:48 +0100)
committerMike Snitzer <snitzer@redhat.com>
Fri, 23 Aug 2013 13:02:14 +0000 (09:02 -0400)
Remove a visited leaf straight away from the stack, rather than
marking all it's children as visited and letting it get removed on the
next iteration.  May also offer a micro optimisation in dm_btree_del.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/persistent-data/dm-btree.c

index 35865425e4b4443e925014fd918655ef51c07d57..e872996e098dcddd73208fcbb2c2c33e82e91ed8 100644 (file)
@@ -287,7 +287,7 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root)
                                        info->value_type.dec(info->value_type.context,
                                                             value_ptr(f->n, i));
                        }
-                       f->current_child = f->nr_children;
+                       pop_frame(s);
                }
        }