summaryrefslogtreecommitdiffstats
path: root/drivers/md/persistent-data/dm-btree-spine.c
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2013-03-01 23:45:50 +0100
committerAlasdair G Kergon <agk@redhat.com>2013-03-01 23:45:50 +0100
commit4e7f1f9089660aec3b5ab2645ce62777c6f4c6a2 (patch)
tree56f012273947dcd88e4a73944aae37d01f023b56 /drivers/md/persistent-data/dm-btree-spine.c
parentdm: add target num_write_bios fn (diff)
downloadlinux-4e7f1f9089660aec3b5ab2645ce62777c6f4c6a2.tar.xz
linux-4e7f1f9089660aec3b5ab2645ce62777c6f4c6a2.zip
dm persistent data: add btree_walk
Add dm_btree_walk to iterate through the contents of a btree. This will be used by the dm cache target. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/persistent-data/dm-btree-spine.c')
-rw-r--r--drivers/md/persistent-data/dm-btree-spine.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c
index f199a0c4ed04..cf9fd676ae44 100644
--- a/drivers/md/persistent-data/dm-btree-spine.c
+++ b/drivers/md/persistent-data/dm-btree-spine.c
@@ -164,6 +164,13 @@ int ro_step(struct ro_spine *s, dm_block_t new_child)
return r;
}
+void ro_pop(struct ro_spine *s)
+{
+ BUG_ON(!s->count);
+ --s->count;
+ unlock_block(s->info, s->nodes[s->count]);
+}
+
struct btree_node *ro_node(struct ro_spine *s)
{
struct dm_block *block;