diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-04-02 19:55:30 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-02 19:55:30 +0100 |
commit | b2a114652940ccf7e9668ad447ca78bf16a31139 (patch) | |
tree | f86e851ff752a8ae5ce1b5571cde1918c86a156a /drivers/md/dm-snap.c | |
parent | ec44ab9d6681ddf9026b593e866bec9c0e075e1d (diff) |
dm exception store: separate type from instance
Introduce struct dm_exception_store_type.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 462750c6631..dabd58e9aaf 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -665,7 +665,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) spin_lock_init(&s->tracked_chunk_lock); /* Metadata must only be loaded into one table at once */ - r = s->store.read_metadata(&s->store, dm_add_exception, (void *)s); + r = s->store.type.read_metadata(&s->store, dm_add_exception, (void *)s); if (r < 0) { ti->error = "Failed to read snapshot metadata"; goto bad_load_and_register; @@ -700,7 +700,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) dm_kcopyd_client_destroy(s->kcopyd_client); bad5: - s->store.destroy(&s->store); + s->store.type.dtr(&s->store); bad4: exit_exception_table(&s->pending, pending_cache); @@ -725,7 +725,7 @@ static void __free_exceptions(struct dm_snapshot *s) exit_exception_table(&s->pending, pending_cache); exit_exception_table(&s->complete, exception_cache); - s->store.destroy(&s->store); + s->store.type.dtr(&s->store); } static void snapshot_dtr(struct dm_target *ti) @@ -820,8 +820,8 @@ static void __invalidate_snapshot(struct dm_snapshot *s, int err) else if (err == -ENOMEM) DMERR("Invalidating snapshot: Unable to allocate exception."); - if (s->store.drop_snapshot) - s->store.drop_snapshot(&s->store); + if (s->store.type.drop_snapshot) + s->store.type.drop_snapshot(&s->store); s->valid = 0; @@ -943,8 +943,8 @@ static void copy_callback(int read_err, unsigned long write_err, void *context) else /* Update the metadata if we are persistent */ - s->store.commit_exception(&s->store, &pe->e, commit_callback, - pe); + s->store.type.commit_exception(&s->store, &pe->e, + commit_callback, pe); } /* @@ -1010,7 +1010,7 @@ __find_pending_exception(struct dm_snapshot *s, atomic_set(&pe->ref_count, 0); pe->started = 0; - if (s->store.prepare_exception(&s->store, &pe->e)) { + if (s->store.type.prepare_exception(&s->store, &pe->e)) { free_pending_exception(pe); return NULL; } @@ -1149,9 +1149,9 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, if (!snap->valid) snprintf(result, maxlen, "Invalid"); else { - if (snap->store.fraction_full) { + if (snap->store.type.fraction_full) { sector_t numerator, denominator; - snap->store.fraction_full(&snap->store, + snap->store.type.fraction_full(&snap->store, &numerator, &denominator); snprintf(result, maxlen, "%llu/%llu", |