dm exception store: add merge specific methods
[firefly-linux-kernel-4.4.55.git] / drivers / md / dm-exception-store.h
index bb8874653de188022a6685311dcd6fe348ffb962..c53e08935b4247fbaa89693ff475c9264d1197f3 100644 (file)
@@ -74,6 +74,23 @@ struct dm_exception_store_type {
                                  void (*callback) (void *, int success),
                                  void *callback_context);
 
+       /*
+        * Returns 0 if the exception store is empty.
+        *
+        * If there are exceptions still to be merged, sets
+        * *last_old_chunk and *last_new_chunk to the most recent
+        * still-to-be-merged chunk and returns the number of
+        * consecutive previous ones.
+        */
+       int (*prepare_merge) (struct dm_exception_store *store,
+                             chunk_t *last_old_chunk, chunk_t *last_new_chunk);
+
+       /*
+        * Clear the last n exceptions.
+        * nr_merged must be <= the value returned by prepare_merge.
+        */
+       int (*commit_merge) (struct dm_exception_store *store, int nr_merged);
+
        /*
         * The snapshot is invalid, note this in the metadata.
         */