]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/dm-exception-store.h
Merge branch 'fix/asoc' into for-linus
[karo-tx-linux.git] / drivers / md / dm-exception-store.h
index d75f775562e58b44f8515fbd4b2f696ef45d7bc5..bb9f33d5daa2169127d96fd9ebfcbe41d1cc819b 100644 (file)
@@ -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
@@ -36,28 +37,32 @@ struct dm_snap_exception {
  * Abstraction to handle the meta/layout of exception stores (the
  * COW device).
  */
-struct exception_store {
+struct dm_exception_store {
        /*
         * Destroys this object when you've finished with it.
         */
-       void (*destroy) (struct exception_store *store);
+       void (*destroy) (struct dm_exception_store *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 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.
         */
-       int (*prepare_exception) (struct exception_store *store,
+       int (*prepare_exception) (struct dm_exception_store *store,
                                  struct dm_snap_exception *e);
 
        /*
         * Update the metadata with this exception.
         */
-       void (*commit_exception) (struct exception_store *store,
+       void (*commit_exception) (struct dm_exception_store *store,
                                  struct dm_snap_exception *e,
                                  void (*callback) (void *, int success),
                                  void *callback_context);
@@ -65,12 +70,15 @@ struct exception_store {
        /*
         * The snapshot is invalid, note this in the metadata.
         */
-       void (*drop_snapshot) (struct exception_store *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.
         */
-       void (*fraction_full) (struct exception_store *store,
+       void (*fraction_full) (struct dm_exception_store *store,
                               sector_t *numerator,
                               sector_t *denominator);
 
@@ -121,11 +129,20 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e)
 
 #  endif
 
+int dm_exception_store_init(void);
+void dm_exception_store_exit(void);
+
 /*
  * Two exception store implementations.
  */
-int dm_create_persistent(struct exception_store *store);
+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 exception_store *store);
+int dm_create_transient(struct dm_exception_store *store);
 
 #endif /* _LINUX_DM_EXCEPTION_STORE */