Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
[firefly-linux-kernel-4.4.55.git] / include / linux / device-mapper.h
index d5f984b0746611c80ba49dd3dfc9a67d5e5a1dd8..1e483fa7afb41b681ba802061d4ae5ab4ad4676a 100644 (file)
@@ -175,6 +175,14 @@ struct target_type {
 #define DM_TARGET_IMMUTABLE            0x00000004
 #define dm_target_is_immutable(type)   ((type)->features & DM_TARGET_IMMUTABLE)
 
+/*
+ * Some targets need to be sent the same WRITE bio severals times so
+ * that they can send copies of it to different devices.  This function
+ * examines any supplied bio and returns the number of copies of it the
+ * target requires.
+ */
+typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio);
+
 struct dm_target {
        struct dm_table *table;
        struct target_type *type;
@@ -214,6 +222,13 @@ struct dm_target {
         */
        unsigned per_bio_data_size;
 
+       /*
+        * If defined, this function is called to find out how many
+        * duplicate bios should be sent to the target when writing
+        * data.
+        */
+       dm_num_write_bios_fn num_write_bios;
+
        /* target specific data */
        void *private;