aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap-transient.c
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2009-01-05 22:05:19 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-01-05 22:05:19 -0500
commita159c1ac5f33c6cf0f5aa3c9d1ccdc82c907ee46 (patch)
tree2cb6bfd3f376e2366f3e3820ebd07a0a86a01cfc /drivers/md/dm-snap-transient.c
parent4db6bfe02bdc7dc5048f46dd682a94801d029adc (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-transient.c')
-rw-r--r--drivers/md/dm-snap-transient.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c
index 2a781df57fe..7f6e2e6dcb0 100644
--- a/drivers/md/dm-snap-transient.c
+++ b/drivers/md/dm-snap-transient.c
@@ -28,13 +28,16 @@ static void transient_destroy(struct dm_exception_store *store)
28 kfree(store->context); 28 kfree(store->context);
29} 29}
30 30
31static int transient_read_metadata(struct dm_exception_store *store) 31static int transient_read_metadata(struct dm_exception_store *store,
32 int (*callback)(void *callback_context,
33 chunk_t old, chunk_t new),
34 void *callback_context)
32{ 35{
33 return 0; 36 return 0;
34} 37}
35 38
36static int transient_prepare(struct dm_exception_store *store, 39static int transient_prepare_exception(struct dm_exception_store *store,
37 struct dm_snap_exception *e) 40 struct dm_snap_exception *e)
38{ 41{
39 struct transient_c *tc = (struct transient_c *) store->context; 42 struct transient_c *tc = (struct transient_c *) store->context;
40 sector_t size = get_dev_size(store->snap->cow->bdev); 43 sector_t size = get_dev_size(store->snap->cow->bdev);
@@ -48,10 +51,10 @@ static int transient_prepare(struct dm_exception_store *store,
48 return 0; 51 return 0;
49} 52}
50 53
51static void transient_commit(struct dm_exception_store *store, 54static void transient_commit_exception(struct dm_exception_store *store,
52 struct dm_snap_exception *e, 55 struct dm_snap_exception *e,
53 void (*callback) (void *, int success), 56 void (*callback) (void *, int success),
54 void *callback_context) 57 void *callback_context)
55{ 58{
56 /* Just succeed */ 59 /* Just succeed */
57 callback(callback_context, 1); 60 callback(callback_context, 1);
@@ -70,8 +73,8 @@ int dm_create_transient(struct dm_exception_store *store)
70 73
71 store->destroy = transient_destroy; 74 store->destroy = transient_destroy;
72 store->read_metadata = transient_read_metadata; 75 store->read_metadata = transient_read_metadata;
73 store->prepare_exception = transient_prepare; 76 store->prepare_exception = transient_prepare_exception;
74 store->commit_exception = transient_commit; 77 store->commit_exception = transient_commit_exception;
75 store->drop_snapshot = NULL; 78 store->drop_snapshot = NULL;
76 store->fraction_full = transient_fraction_full; 79 store->fraction_full = transient_fraction_full;
77 80