#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
* COW device).
*/
struct dm_exception_store {
-
/*
* Destroys this object when you've finished with it.
*/
/*
* 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.
*/
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.
*/
# endif
+int dm_exception_store_init(void);
+void dm_exception_store_exit(void);
+
/*
* Two exception store implementations.
*/
+int dm_persistent_snapshot_init(void);
+void dm_persistent_snapshot_exit(void);
+
+int dm_transient_snapshot_init(void);
+void dm_transient_snapshot_exit(void);
+
int dm_create_persistent(struct dm_exception_store *store);
int dm_create_transient(struct dm_exception_store *store);