diff options
Diffstat (limited to 'drivers/md/dm-snap-persistent.c')
-rw-r--r-- | drivers/md/dm-snap-persistent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 767065f6c5f3..157999ebd236 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
@@ -214,7 +214,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw, | |||
214 | int metadata) | 214 | int metadata) |
215 | { | 215 | { |
216 | struct dm_io_region where = { | 216 | struct dm_io_region where = { |
217 | .bdev = ps->store->cow->bdev, | 217 | .bdev = dm_snap_cow(ps->store->snap)->bdev, |
218 | .sector = ps->store->chunk_size * chunk, | 218 | .sector = ps->store->chunk_size * chunk, |
219 | .count = ps->store->chunk_size, | 219 | .count = ps->store->chunk_size, |
220 | }; | 220 | }; |
@@ -294,7 +294,8 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
294 | */ | 294 | */ |
295 | if (!ps->store->chunk_size) { | 295 | if (!ps->store->chunk_size) { |
296 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, | 296 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, |
297 | bdev_logical_block_size(ps->store->cow->bdev) >> 9); | 297 | bdev_logical_block_size(dm_snap_cow(ps->store->snap)-> |
298 | bdev) >> 9); | ||
298 | ps->store->chunk_mask = ps->store->chunk_size - 1; | 299 | ps->store->chunk_mask = ps->store->chunk_size - 1; |
299 | ps->store->chunk_shift = ffs(ps->store->chunk_size) - 1; | 300 | ps->store->chunk_shift = ffs(ps->store->chunk_size) - 1; |
300 | chunk_size_supplied = 0; | 301 | chunk_size_supplied = 0; |
@@ -497,7 +498,7 @@ static void persistent_usage(struct dm_exception_store *store, | |||
497 | struct pstore *ps = get_info(store); | 498 | struct pstore *ps = get_info(store); |
498 | 499 | ||
499 | *sectors_allocated = ps->next_free * store->chunk_size; | 500 | *sectors_allocated = ps->next_free * store->chunk_size; |
500 | *total_sectors = get_dev_size(store->cow->bdev); | 501 | *total_sectors = get_dev_size(dm_snap_cow(store->snap)->bdev); |
501 | 502 | ||
502 | /* | 503 | /* |
503 | * First chunk is the fixed header. | 504 | * First chunk is the fixed header. |
@@ -596,7 +597,7 @@ static int persistent_prepare_exception(struct dm_exception_store *store, | |||
596 | struct pstore *ps = get_info(store); | 597 | struct pstore *ps = get_info(store); |
597 | uint32_t stride; | 598 | uint32_t stride; |
598 | chunk_t next_free; | 599 | chunk_t next_free; |
599 | sector_t size = get_dev_size(store->cow->bdev); | 600 | sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev); |
600 | 601 | ||
601 | /* Is there enough room ? */ | 602 | /* Is there enough room ? */ |
602 | if (size < ((ps->next_free + 1) * store->chunk_size)) | 603 | if (size < ((ps->next_free + 1) * store->chunk_size)) |
@@ -733,8 +734,7 @@ static unsigned persistent_status(struct dm_exception_store *store, | |||
733 | case STATUSTYPE_INFO: | 734 | case STATUSTYPE_INFO: |
734 | break; | 735 | break; |
735 | case STATUSTYPE_TABLE: | 736 | case STATUSTYPE_TABLE: |
736 | DMEMIT(" %s P %llu", store->cow->name, | 737 | DMEMIT(" P %llu", (unsigned long long)store->chunk_size); |
737 | (unsigned long long)store->chunk_size); | ||
738 | } | 738 | } |
739 | 739 | ||
740 | return sz; | 740 | return sz; |