summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2009-04-02 19:55:32 +0100
committerAlasdair G Kergon <agk@redhat.com>2009-04-02 19:55:32 +0100
commit0cea9c78270cdf1d2ad74ce0e083d5555a0842e8 (patch)
tree783785811de9ed558ec1179a6bc201dd6161cae6
parent493df71c6420b211a68ae82b889c1e8a5fe701be (diff)
downloadop-kernel-dev-0cea9c78270cdf1d2ad74ce0e083d5555a0842e8.zip
op-kernel-dev-0cea9c78270cdf1d2ad74ce0e083d5555a0842e8.tar.gz
dm exception store: move dm_target pointer
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>
-rw-r--r--drivers/md/dm-exception-store.c3
-rw-r--r--drivers/md/dm-exception-store.h3
-rw-r--r--drivers/md/dm-snap.c7
-rw-r--r--drivers/md/dm-snap.h1
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index 8912a36..fe0cfa6 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -137,7 +137,7 @@ int dm_exception_store_type_unregister(struct dm_exception_store_type *type)
}
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;
@@ -155,6 +155,7 @@ int dm_exception_store_create(const char *type_name,
}
tmp_store->type = type;
+ tmp_store->ti = ti;
r = type->ctr(tmp_store, 0, NULL);
if (r) {
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
index 3137715..4b7f7d4 100644
--- a/drivers/md/dm-exception-store.h
+++ b/drivers/md/dm-exception-store.h
@@ -95,6 +95,7 @@ struct dm_exception_store_type {
struct dm_exception_store {
struct dm_exception_store_type *type;
+ struct dm_target *ti;
struct dm_snapshot *snap;
@@ -147,7 +148,7 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e)
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);
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index be698f3..4429c2a 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -615,7 +615,6 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
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)) {
@@ -624,7 +623,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
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;
@@ -820,7 +819,7 @@ static void __invalidate_snapshot(struct dm_snapshot *s, int err)
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)
@@ -1196,7 +1195,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)
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;
/*
diff --git a/drivers/md/dm-snap.h b/drivers/md/dm-snap.h
index 627be0f..93cd8ee 100644
--- a/drivers/md/dm-snap.h
+++ b/drivers/md/dm-snap.h
@@ -25,7 +25,6 @@ struct exception_table {
struct dm_snapshot {
struct rw_semaphore lock;
- struct dm_target *ti;
struct dm_dev *origin;
struct dm_dev *cow;
OpenPOWER on IntegriCloud