dm snapshot: style cleanups

Coding style cleanups.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
This commit is contained in:
Jonathan Brassow 2011-08-02 12:32:03 +01:00 committed by Alasdair G Kergon
parent aa3f0794d2
commit a2d2b0345a
2 changed files with 8 additions and 10 deletions

View File

@ -567,7 +567,7 @@ static int persistent_read_metadata(struct dm_exception_store *store,
ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) / ps->exceptions_per_area = (ps->store->chunk_size << SECTOR_SHIFT) /
sizeof(struct disk_exception); sizeof(struct disk_exception);
ps->callbacks = dm_vcalloc(ps->exceptions_per_area, ps->callbacks = dm_vcalloc(ps->exceptions_per_area,
sizeof(*ps->callbacks)); sizeof(*ps->callbacks));
if (!ps->callbacks) if (!ps->callbacks)
return -ENOMEM; return -ENOMEM;
@ -674,7 +674,7 @@ static void persistent_commit_exception(struct dm_exception_store *store,
* If we completely filled the current area, then wipe the next one. * If we completely filled the current area, then wipe the next one.
*/ */
if ((ps->current_committed == ps->exceptions_per_area) && if ((ps->current_committed == ps->exceptions_per_area) &&
zero_disk_area(ps, ps->current_area + 1)) zero_disk_area(ps, ps->current_area + 1))
ps->valid = 0; ps->valid = 0;
/* /*

View File

@ -1045,8 +1045,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
s = kmalloc(sizeof(*s), GFP_KERNEL); s = kmalloc(sizeof(*s), GFP_KERNEL);
if (!s) { if (!s) {
ti->error = "Cannot allocate snapshot context private " ti->error = "Cannot allocate private snapshot structure";
"structure";
r = -ENOMEM; r = -ENOMEM;
goto bad; goto bad;
} }
@ -1405,7 +1404,7 @@ static void pending_complete(struct dm_snap_pending_exception *pe, int success)
*/ */
dm_insert_exception(&s->complete, e); dm_insert_exception(&s->complete, e);
out: out:
dm_remove_exception(&pe->e); dm_remove_exception(&pe->e);
snapshot_bios = bio_list_get(&pe->snapshot_bios); snapshot_bios = bio_list_get(&pe->snapshot_bios);
origin_bios = bio_list_get(&pe->origin_bios); origin_bios = bio_list_get(&pe->origin_bios);
@ -1470,8 +1469,7 @@ static void start_copy(struct dm_snap_pending_exception *pe)
dest.count = src.count; dest.count = src.count;
/* Hand over to kcopyd */ /* Hand over to kcopyd */
dm_kcopyd_copy(s->kcopyd_client, dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe);
&src, 1, &dest, 0, copy_callback, pe);
} }
static struct dm_snap_pending_exception * static struct dm_snap_pending_exception *
@ -1618,9 +1616,9 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
map_context->ptr = track_chunk(s, chunk); map_context->ptr = track_chunk(s, chunk);
} }
out_unlock: out_unlock:
up_write(&s->lock); up_write(&s->lock);
out: out:
return r; return r;
} }
@ -1964,7 +1962,7 @@ static int __origin_write(struct list_head *snapshots, sector_t sector,
pe_to_start_now = pe; pe_to_start_now = pe;
} }
next_snapshot: next_snapshot:
up_write(&snap->lock); up_write(&snap->lock);
if (pe_to_start_now) { if (pe_to_start_now) {