Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347946
b: refs/heads/master
c: e3cbf94
h: refs/heads/master
v: v3
  • Loading branch information
Joe Thornber authored and Alasdair G Kergon committed Dec 21, 2012
1 parent 6a7f897 commit 0fe2225
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 563af186df08002d2600c4e718ad8f3bde109f53
refs/heads/master: e3cbf94513c21516fbb44561857b155d1c599625
2 changes: 1 addition & 1 deletion trunk/drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static void __setup_btree_details(struct dm_pool_metadata *pmd)

pmd->tl_info.tm = pmd->tm;
pmd->tl_info.levels = 1;
pmd->tl_info.value_type.context = &pmd->info;
pmd->tl_info.value_type.context = &pmd->bl_info;
pmd->tl_info.value_type.size = sizeof(__le64);
pmd->tl_info.value_type.inc = subtree_inc;
pmd->tl_info.value_type.dec = subtree_dec;
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/md/persistent-data/dm-btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ static void pop_frame(struct del_stack *s)
dm_tm_unlock(s->tm, f->b);
}

static bool is_internal_level(struct dm_btree_info *info, struct frame *f)
{
return f->level < (info->levels - 1);
}

int dm_btree_del(struct dm_btree_info *info, dm_block_t root)
{
int r;
Expand All @@ -241,7 +246,7 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root)
s->tm = info->tm;
s->top = -1;

r = push_frame(s, root, 1);
r = push_frame(s, root, 0);
if (r)
goto out;

Expand All @@ -267,7 +272,7 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root)
if (r)
goto out;

} else if (f->level != (info->levels - 1)) {
} else if (is_internal_level(info, f)) {
b = value64(f->n, f->current_child);
f->current_child++;
r = push_frame(s, b, f->level + 1);
Expand Down

0 comments on commit 0fe2225

Please sign in to comment.