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-exception-store.h | |
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-exception-store.h')
-rw-r--r-- | drivers/md/dm-exception-store.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h index 78d1acec77e9..bb9f33d5daa2 100644 --- a/drivers/md/dm-exception-store.h +++ b/drivers/md/dm-exception-store.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define _LINUX_DM_EXCEPTION_STORE | 11 | #define _LINUX_DM_EXCEPTION_STORE |
12 | 12 | ||
13 | #include <linux/blkdev.h> | 13 | #include <linux/blkdev.h> |
14 | #include <linux/device-mapper.h> | ||
14 | 15 | ||
15 | /* | 16 | /* |
16 | * The snapshot code deals with largish chunks of the disk at a | 17 | * The snapshot code deals with largish chunks of the disk at a |
@@ -37,7 +38,6 @@ struct dm_snap_exception { | |||
37 | * COW device). | 38 | * COW device). |
38 | */ | 39 | */ |
39 | struct dm_exception_store { | 40 | struct dm_exception_store { |
40 | |||
41 | /* | 41 | /* |
42 | * Destroys this object when you've finished with it. | 42 | * Destroys this object when you've finished with it. |
43 | */ | 43 | */ |
@@ -45,9 +45,13 @@ struct dm_exception_store { | |||
45 | 45 | ||
46 | /* | 46 | /* |
47 | * The target shouldn't read the COW device until this is | 47 | * The target shouldn't read the COW device until this is |
48 | * called. | 48 | * called. As exceptions are read from the COW, they are |
49 | * reported back via the callback. | ||
49 | */ | 50 | */ |
50 | int (*read_metadata) (struct dm_exception_store *store); | 51 | int (*read_metadata) (struct dm_exception_store *store, |
52 | int (*callback)(void *callback_context, | ||
53 | chunk_t old, chunk_t new), | ||
54 | void *callback_context); | ||
51 | 55 | ||
52 | /* | 56 | /* |
53 | * Find somewhere to store the next exception. | 57 | * Find somewhere to store the next exception. |
@@ -68,6 +72,9 @@ struct dm_exception_store { | |||
68 | */ | 72 | */ |
69 | void (*drop_snapshot) (struct dm_exception_store *store); | 73 | void (*drop_snapshot) (struct dm_exception_store *store); |
70 | 74 | ||
75 | int (*status) (struct dm_exception_store *store, status_type_t status, | ||
76 | char *result, unsigned int maxlen); | ||
77 | |||
71 | /* | 78 | /* |
72 | * Return how full the snapshot is. | 79 | * Return how full the snapshot is. |
73 | */ | 80 | */ |