]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/device-mapper.h
Merge tag 'libnvdimm-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
[karo-tx-linux.git] / include / linux / device-mapper.h
index df830d16789277ef9dcc7dbe7a168b47148a9ded..f4c639c0c362fd4c5106c5a6d2d6ceae1f3c795a 100644 (file)
@@ -22,11 +22,13 @@ struct bio_vec;
 /*
  * Type of table, mapped_device's mempool and request_queue
  */
-#define DM_TYPE_NONE                   0
-#define DM_TYPE_BIO_BASED              1
-#define DM_TYPE_REQUEST_BASED          2
-#define DM_TYPE_MQ_REQUEST_BASED       3
-#define DM_TYPE_DAX_BIO_BASED          4
+enum dm_queue_mode {
+       DM_TYPE_NONE             = 0,
+       DM_TYPE_BIO_BASED        = 1,
+       DM_TYPE_REQUEST_BASED    = 2,
+       DM_TYPE_MQ_REQUEST_BASED = 3,
+       DM_TYPE_DAX_BIO_BASED    = 4,
+};
 
 typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t;
 
@@ -223,6 +225,18 @@ struct target_type {
  */
 typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio);
 
+/*
+ * A target implements own bio data integrity.
+ */
+#define DM_TARGET_INTEGRITY            0x00000010
+#define dm_target_has_integrity(type)  ((type)->features & DM_TARGET_INTEGRITY)
+
+/*
+ * A target passes integrity data to the lower device.
+ */
+#define DM_TARGET_PASSES_INTEGRITY     0x00000020
+#define dm_target_passes_integrity(type) ((type)->features & DM_TARGET_PASSES_INTEGRITY)
+
 struct dm_target {
        struct dm_table *table;
        struct target_type *type;
@@ -256,6 +270,12 @@ struct dm_target {
         */
        unsigned num_write_same_bios;
 
+       /*
+        * The number of WRITE ZEROES bios that will be submitted to the target.
+        * The bio number can be accessed with dm_bio_get_target_bio_nr.
+        */
+       unsigned num_write_zeroes_bios;
+
        /*
         * The minimum number of extra bytes allocated in each io for the
         * target to use.
@@ -292,11 +312,6 @@ struct dm_target {
         * on max_io_len boundary.
         */
        bool split_discard_bios:1;
-
-       /*
-        * Set if this target does not return zeroes on discarded blocks.
-        */
-       bool discard_zeroes_data_unsupported:1;
 };
 
 /* Each target can link one of these into the table */
@@ -466,7 +481,7 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback
  * Useful for "hybrid" target (supports both bio-based
  * and request-based).
  */
-void dm_table_set_type(struct dm_table *t, unsigned type);
+void dm_table_set_type(struct dm_table *t, enum dm_queue_mode type);
 
 /*
  * Finally call this to make the table ready for use.
@@ -580,6 +595,7 @@ extern struct ratelimit_state dm_ratelimit_state;
 /*
  * Definitions of return values from target end_io function.
  */
+#define DM_ENDIO_DONE          0
 #define DM_ENDIO_INCOMPLETE    1
 #define DM_ENDIO_REQUEUE       2
 
@@ -590,6 +606,7 @@ extern struct ratelimit_state dm_ratelimit_state;
 #define DM_MAPIO_REMAPPED      1
 #define DM_MAPIO_REQUEUE       DM_ENDIO_REQUEUE
 #define DM_MAPIO_DELAY_REQUEUE 3
+#define DM_MAPIO_KILL          4
 
 #define dm_sector_div64(x, y)( \
 { \