summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-exception-store.h
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2009-01-06 04:05:19 +0100
committerAlasdair G Kergon <agk@redhat.com>2009-01-06 04:05:19 +0100
commita159c1ac5f33c6cf0f5aa3c9d1ccdc82c907ee46 (patch)
tree2cb6bfd3f376e2366f3e3820ebd07a0a86a01cfc /drivers/md/dm-exception-store.h
parentdm snapshot: split out exception store implementations (diff)
downloadlinux-a159c1ac5f33c6cf0f5aa3c9d1ccdc82c907ee46.tar.xz
linux-a159c1ac5f33c6cf0f5aa3c9d1ccdc82c907ee46.zip
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.h13
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 @@
#define _LINUX_DM_EXCEPTION_STORE
#include <linux/blkdev.h>
+#include <linux/device-mapper.h>
/*
* The snapshot code deals with largish chunks of the disk at a
@@ -37,7 +38,6 @@ struct dm_snap_exception {
* COW device).
*/
struct dm_exception_store {
-
/*
* Destroys this object when you've finished with it.
*/
@@ -45,9 +45,13 @@ struct dm_exception_store {
/*
* The target shouldn't read the COW device until this is
- * called.
+ * called. As exceptions are read from the COW, they are
+ * reported back via the callback.
*/
- int (*read_metadata) (struct dm_exception_store *store);
+ int (*read_metadata) (struct dm_exception_store *store,
+ int (*callback)(void *callback_context,
+ chunk_t old, chunk_t new),
+ void *callback_context);
/*
* Find somewhere to store the next exception.
@@ -68,6 +72,9 @@ struct dm_exception_store {
*/
void (*drop_snapshot) (struct dm_exception_store *store);
+ int (*status) (struct dm_exception_store *store, status_type_t status,
+ char *result, unsigned int maxlen);
+
/*
* Return how full the snapshot is.
*/