summaryrefslogtreecommitdiff
path: root/drivers/md/dm-snap-transient.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2009-12-10 23:52:12 +0000
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 23:52:12 +0000
commitfc56f6fbcca3672c63c93c65f45105faacfc13cb (patch)
treef50f42a461ef33f8617fbdb781879e6ae77b62c4 /drivers/md/dm-snap-transient.c
parent985903bb3a6d98623360ab6c855417f638840029 (diff)
dm snapshot: move cow ref from exception store to snap core
Store the reference to the snapshot cow device in the core snapshot code instead of each exception store. It can be accessed through the new function dm_snap_cow(). Exception stores should each now maintain a reference to their parent snapshot struct. This is cleaner and makes part of the forthcoming snapshot merge code simpler. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Reviewed-by: Jonathan Brassow <jbrassow@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md/dm-snap-transient.c')
-rw-r--r--drivers/md/dm-snap-transient.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c
index 245a50c7337e..a0898a66a2f8 100644
--- a/drivers/md/dm-snap-transient.c
+++ b/drivers/md/dm-snap-transient.c
@@ -39,7 +39,7 @@ static int transient_prepare_exception(struct dm_exception_store *store,
struct dm_exception *e)
{
struct transient_c *tc = store->context;
- sector_t size = get_dev_size(store->cow->bdev);
+ sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev);
if (size < (tc->next_free + store->chunk_size))
return -1;
@@ -65,7 +65,7 @@ static void transient_usage(struct dm_exception_store *store,
sector_t *metadata_sectors)
{
*sectors_allocated = ((struct transient_c *) store->context)->next_free;
- *total_sectors = get_dev_size(store->cow->bdev);
+ *total_sectors = get_dev_size(dm_snap_cow(store->snap)->bdev);
*metadata_sectors = 0;
}
@@ -94,8 +94,7 @@ static unsigned transient_status(struct dm_exception_store *store,
case STATUSTYPE_INFO:
break;
case STATUSTYPE_TABLE:
- DMEMIT(" %s N %llu", store->cow->name,
- (unsigned long long)store->chunk_size);
+ DMEMIT(" N %llu", (unsigned long long)store->chunk_size);
}
return sz;