Move target pointer from snapshot to exception store.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
 }
 EXPORT_SYMBOL(dm_exception_store_type_unregister);
 
-int dm_exception_store_create(const char *type_name,
+int dm_exception_store_create(const char *type_name, struct dm_target *ti,
                              struct dm_exception_store **store)
 {
        int r = 0;
        }
 
        tmp_store->type = type;
+       tmp_store->ti = ti;
 
        r = type->ctr(tmp_store, 0, NULL);
        if (r) {
 
 
 struct dm_exception_store {
        struct dm_exception_store_type *type;
+       struct dm_target *ti;
 
        struct dm_snapshot *snap;
 
 int dm_exception_store_type_register(struct dm_exception_store_type *type);
 int dm_exception_store_type_unregister(struct dm_exception_store_type *type);
 
-int dm_exception_store_create(const char *type_name,
+int dm_exception_store_create(const char *type_name, struct dm_target *ti,
                              struct dm_exception_store **store);
 void dm_exception_store_destroy(struct dm_exception_store *store);
 
 
        atomic_set(&s->pending_exceptions_count, 0);
        init_rwsem(&s->lock);
        spin_lock_init(&s->pe_lock);
-       s->ti = ti;
 
        /* Allocate hash table for COW data */
        if (init_hash_tables(s)) {
                goto bad3;
        }
 
-       r = dm_exception_store_create(argv[2], &s->store);
+       r = dm_exception_store_create(argv[2], ti, &s->store);
        if (r) {
                ti->error = "Couldn't create exception store";
                r = -EINVAL;
 
        s->valid = 0;
 
-       dm_table_event(s->ti->table);
+       dm_table_event(s->store->ti->table);
 }
 
 static void get_pending_exception(struct dm_snap_pending_exception *pe)
                        goto next_snapshot;
 
                /* Nothing to do if writing beyond end of snapshot */
-               if (bio->bi_sector >= dm_table_get_size(snap->ti->table))
+               if (bio->bi_sector >= dm_table_get_size(snap->store->ti->table))
                        goto next_snapshot;
 
                /*
 
 
 struct dm_snapshot {
        struct rw_semaphore lock;
-       struct dm_target *ti;
 
        struct dm_dev *origin;
        struct dm_dev *cow;