diff options
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 5c067efc665f..467c586e2439 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -637,8 +637,6 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
637 | goto bad4; | 637 | goto bad4; |
638 | } | 638 | } |
639 | 639 | ||
640 | s->store->snap = s; | ||
641 | |||
642 | r = dm_kcopyd_client_create(SNAPSHOT_PAGES, &s->kcopyd_client); | 640 | r = dm_kcopyd_client_create(SNAPSHOT_PAGES, &s->kcopyd_client); |
643 | if (r) { | 641 | if (r) { |
644 | ti->error = "Could not create kcopyd client"; | 642 | ti->error = "Could not create kcopyd client"; |
@@ -962,11 +960,11 @@ static void start_copy(struct dm_snap_pending_exception *pe) | |||
962 | dev_size = get_dev_size(bdev); | 960 | dev_size = get_dev_size(bdev); |
963 | 961 | ||
964 | src.bdev = bdev; | 962 | src.bdev = bdev; |
965 | src.sector = chunk_to_sector(s, pe->e.old_chunk); | 963 | src.sector = chunk_to_sector(s->store, pe->e.old_chunk); |
966 | src.count = min(s->store->chunk_size, dev_size - src.sector); | 964 | src.count = min(s->store->chunk_size, dev_size - src.sector); |
967 | 965 | ||
968 | dest.bdev = s->store->cow->bdev; | 966 | dest.bdev = s->store->cow->bdev; |
969 | dest.sector = chunk_to_sector(s, pe->e.new_chunk); | 967 | dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); |
970 | dest.count = src.count; | 968 | dest.count = src.count; |
971 | 969 | ||
972 | /* Hand over to kcopyd */ | 970 | /* Hand over to kcopyd */ |
@@ -1027,9 +1025,11 @@ static void remap_exception(struct dm_snapshot *s, struct dm_snap_exception *e, | |||
1027 | struct bio *bio, chunk_t chunk) | 1025 | struct bio *bio, chunk_t chunk) |
1028 | { | 1026 | { |
1029 | bio->bi_bdev = s->store->cow->bdev; | 1027 | bio->bi_bdev = s->store->cow->bdev; |
1030 | bio->bi_sector = chunk_to_sector(s, dm_chunk_number(e->new_chunk) + | 1028 | bio->bi_sector = chunk_to_sector(s->store, |
1031 | (chunk - e->old_chunk)) + | 1029 | dm_chunk_number(e->new_chunk) + |
1032 | (bio->bi_sector & s->store->chunk_mask); | 1030 | (chunk - e->old_chunk)) + |
1031 | (bio->bi_sector & | ||
1032 | s->store->chunk_mask); | ||
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | static int snapshot_map(struct dm_target *ti, struct bio *bio, | 1035 | static int snapshot_map(struct dm_target *ti, struct bio *bio, |
@@ -1041,7 +1041,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio, | |||
1041 | chunk_t chunk; | 1041 | chunk_t chunk; |
1042 | struct dm_snap_pending_exception *pe = NULL; | 1042 | struct dm_snap_pending_exception *pe = NULL; |
1043 | 1043 | ||
1044 | chunk = sector_to_chunk(s, bio->bi_sector); | 1044 | chunk = sector_to_chunk(s->store, bio->bi_sector); |
1045 | 1045 | ||
1046 | /* Full snapshots are not usable */ | 1046 | /* Full snapshots are not usable */ |
1047 | /* To get here the table must be live so s->active is always set. */ | 1047 | /* To get here the table must be live so s->active is always set. */ |
@@ -1210,7 +1210,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio) | |||
1210 | * Remember, different snapshots can have | 1210 | * Remember, different snapshots can have |
1211 | * different chunk sizes. | 1211 | * different chunk sizes. |
1212 | */ | 1212 | */ |
1213 | chunk = sector_to_chunk(snap, bio->bi_sector); | 1213 | chunk = sector_to_chunk(snap->store, bio->bi_sector); |
1214 | 1214 | ||
1215 | /* | 1215 | /* |
1216 | * Check exception table to see if block | 1216 | * Check exception table to see if block |