diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2008-04-24 16:43:11 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2008-04-25 08:26:40 -0400 |
commit | 72727bad544b4ce0a3f7853bfd7ae939f398007d (patch) | |
tree | 97961bf4031c9fa1739f545e6030e8ab6cbf0ecc /drivers/md | |
parent | 769aef30f0f505c44bbe9fcd2c911a052a386139 (diff) |
dm snapshot: store pointer to target instance
Save pointer to dm_target in dm_snapshot structure.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-snap.c | 6 | ||||
-rw-r--r-- | drivers/md/dm-snap.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 08047fb1cac9..08a8cbddb60d 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -536,7 +536,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
536 | s->last_percent = 0; | 536 | s->last_percent = 0; |
537 | init_rwsem(&s->lock); | 537 | init_rwsem(&s->lock); |
538 | spin_lock_init(&s->pe_lock); | 538 | spin_lock_init(&s->pe_lock); |
539 | s->table = ti->table; | 539 | s->ti = ti; |
540 | 540 | ||
541 | /* Allocate hash table for COW data */ | 541 | /* Allocate hash table for COW data */ |
542 | if (init_hash_tables(s)) { | 542 | if (init_hash_tables(s)) { |
@@ -699,7 +699,7 @@ static void __invalidate_snapshot(struct dm_snapshot *s, int err) | |||
699 | 699 | ||
700 | s->valid = 0; | 700 | s->valid = 0; |
701 | 701 | ||
702 | dm_table_event(s->table); | 702 | dm_table_event(s->ti->table); |
703 | } | 703 | } |
704 | 704 | ||
705 | static void get_pending_exception(struct dm_snap_pending_exception *pe) | 705 | static void get_pending_exception(struct dm_snap_pending_exception *pe) |
@@ -1060,7 +1060,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio) | |||
1060 | goto next_snapshot; | 1060 | goto next_snapshot; |
1061 | 1061 | ||
1062 | /* Nothing to do if writing beyond end of snapshot */ | 1062 | /* Nothing to do if writing beyond end of snapshot */ |
1063 | if (bio->bi_sector >= dm_table_get_size(snap->table)) | 1063 | if (bio->bi_sector >= dm_table_get_size(snap->ti->table)) |
1064 | goto next_snapshot; | 1064 | goto next_snapshot; |
1065 | 1065 | ||
1066 | /* | 1066 | /* |
diff --git a/drivers/md/dm-snap.h b/drivers/md/dm-snap.h index 93bce5d49742..434d1dbe6bce 100644 --- a/drivers/md/dm-snap.h +++ b/drivers/md/dm-snap.h | |||
@@ -132,7 +132,7 @@ struct exception_store { | |||
132 | 132 | ||
133 | struct dm_snapshot { | 133 | struct dm_snapshot { |
134 | struct rw_semaphore lock; | 134 | struct rw_semaphore lock; |
135 | struct dm_table *table; | 135 | struct dm_target *ti; |
136 | 136 | ||
137 | struct dm_dev *origin; | 137 | struct dm_dev *origin; |
138 | struct dm_dev *cow; | 138 | struct dm_dev *cow; |