From: Mikulas Patocka <mpatocka@redhat.com>

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>

---
 drivers/md/dm-snap.c |    6 +++---
 drivers/md/dm-snap.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6.25/drivers/md/dm-snap.c
===================================================================
--- linux-2.6.25.orig/drivers/md/dm-snap.c	2008-04-24 18:00:22.000000000 +0100
+++ linux-2.6.25/drivers/md/dm-snap.c	2008-04-24 18:00:26.000000000 +0100
@@ -536,7 +536,7 @@ static int snapshot_ctr(struct dm_target
 	s->last_percent = 0;
 	init_rwsem(&s->lock);
 	spin_lock_init(&s->pe_lock);
-	s->table = ti->table;
+	s->ti = ti;
 
 	/* Allocate hash table for COW data */
 	if (init_hash_tables(s)) {
@@ -699,7 +699,7 @@ static void __invalidate_snapshot(struct
 
 	s->valid = 0;
 
-	dm_table_event(s->table);
+	dm_table_event(s->ti->table);
 }
 
 static void get_pending_exception(struct dm_snap_pending_exception *pe)
@@ -1060,7 +1060,7 @@ static int __origin_write(struct list_he
 			goto next_snapshot;
 
 		/* Nothing to do if writing beyond end of snapshot */
-		if (bio->bi_sector >= dm_table_get_size(snap->table))
+		if (bio->bi_sector >= dm_table_get_size(snap->ti->table))
 			goto next_snapshot;
 
 		/*
Index: linux-2.6.25/drivers/md/dm-snap.h
===================================================================
--- linux-2.6.25.orig/drivers/md/dm-snap.h	2008-04-24 17:43:47.000000000 +0100
+++ linux-2.6.25/drivers/md/dm-snap.h	2008-04-24 18:00:26.000000000 +0100
@@ -132,7 +132,7 @@ struct exception_store {
 
 struct dm_snapshot {
 	struct rw_semaphore lock;
-	struct dm_table *table;
+	struct dm_target *ti;
 
 	struct dm_dev *origin;
 	struct dm_dev *cow;
