diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-01-05 22:05:19 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-01-05 22:05:19 -0500 |
commit | a159c1ac5f33c6cf0f5aa3c9d1ccdc82c907ee46 (patch) | |
tree | 2cb6bfd3f376e2366f3e3820ebd07a0a86a01cfc /drivers/md/dm-snap.c | |
parent | 4db6bfe02bdc7dc5048f46dd682a94801d029adc (diff) |
dm snapshot: extend exception store functions
Supply dm_add_exception as a callback to the read_metadata function.
Add a status function ready for a later patch and name the functions
consistently.
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 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 018b567fc758..65ff82ff124e 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -430,8 +430,13 @@ out: | |||
430 | list_add(&new_e->hash_list, e ? &e->hash_list : l); | 430 | list_add(&new_e->hash_list, e ? &e->hash_list : l); |
431 | } | 431 | } |
432 | 432 | ||
433 | int dm_add_exception(struct dm_snapshot *s, chunk_t old, chunk_t new) | 433 | /* |
434 | * Callback used by the exception stores to load exceptions when | ||
435 | * initialising. | ||
436 | */ | ||
437 | static int dm_add_exception(void *context, chunk_t old, chunk_t new) | ||
434 | { | 438 | { |
439 | struct dm_snapshot *s = context; | ||
435 | struct dm_snap_exception *e; | 440 | struct dm_snap_exception *e; |
436 | 441 | ||
437 | e = alloc_exception(); | 442 | e = alloc_exception(); |
@@ -660,7 +665,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
660 | spin_lock_init(&s->tracked_chunk_lock); | 665 | spin_lock_init(&s->tracked_chunk_lock); |
661 | 666 | ||
662 | /* Metadata must only be loaded into one table at once */ | 667 | /* Metadata must only be loaded into one table at once */ |
663 | r = s->store.read_metadata(&s->store); | 668 | r = s->store.read_metadata(&s->store, dm_add_exception, (void *)s); |
664 | if (r < 0) { | 669 | if (r < 0) { |
665 | ti->error = "Failed to read snapshot metadata"; | 670 | ti->error = "Failed to read snapshot metadata"; |
666 | goto bad_load_and_register; | 671 | goto bad_load_and_register; |