diff options
Diffstat (limited to 'drivers/md/persistent-data')
-rw-r--r-- | drivers/md/persistent-data/dm-btree-spine.c | 6 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-space-map-disk.c | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c index a04784bab21e..27f379c13809 100644 --- a/drivers/md/persistent-data/dm-btree-spine.c +++ b/drivers/md/persistent-data/dm-btree-spine.c @@ -133,9 +133,8 @@ void exit_ro_spine(struct ro_spine *s) { int i; - for (i = 0; i < s->count; i++) { + for (i = 0; i < s->count; i++) unlock_block(s->info, s->nodes[i]); - } } int ro_step(struct ro_spine *s, dm_block_t new_child) @@ -184,9 +183,8 @@ void exit_shadow_spine(struct shadow_spine *s) { int i; - for (i = 0; i < s->count; i++) { + for (i = 0; i < s->count; i++) unlock_block(s->info, s->nodes[i]); - } } int shadow_step(struct shadow_spine *s, dm_block_t b, diff --git a/drivers/md/persistent-data/dm-space-map-disk.c b/drivers/md/persistent-data/dm-space-map-disk.c index 4494fa503d47..f4241f54e20e 100644 --- a/drivers/md/persistent-data/dm-space-map-disk.c +++ b/drivers/md/persistent-data/dm-space-map-disk.c @@ -95,9 +95,8 @@ static int sm_disk_set_count(struct dm_space_map *sm, dm_block_t b, struct sm_disk *smd = container_of(sm, struct sm_disk, sm); r = sm_ll_insert(&smd->ll, b, count, &nr_allocations); - if (!r) { + if (!r) smd->nr_allocated_this_transaction += nr_allocations; - } return r; } @@ -138,22 +137,20 @@ static int sm_disk_new_block(struct dm_space_map *sm, dm_block_t *b) * Any block we allocate has to be free in both the old and current ll. */ r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, smd->begin, smd->ll.nr_blocks, b); - if (r == -ENOSPC) { + if (r == -ENOSPC) /* * There's no free block between smd->begin and the end of the metadata device. * We search before smd->begin in case something has been freed. */ r = sm_ll_find_common_free_block(&smd->old_ll, &smd->ll, 0, smd->begin, b); - } if (r) return r; smd->begin = *b + 1; r = sm_ll_inc(&smd->ll, *b, *b + 1, &nr_allocations); - if (!r) { + if (!r) smd->nr_allocated_this_transaction += nr_allocations; - } return r; } |