diff options
author | Mike Snitzer <snitzer@redhat.com> | 2016-05-24 21:16:51 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2016-06-10 15:16:02 -0400 |
commit | e83068a5faafb8ca65d3b58bd1e1e3959ce1ddce (patch) | |
tree | 9158ec7acad94d7035153f84e8ff53205caf7315 /include/linux/device-mapper.h | |
parent | bf661be1fcf9b1da8abc81a56ff41ce5964ce896 (diff) |
dm mpath: add optional "queue_mode" feature
Allow a user to specify an optional feature 'queue_mode <mode>' where
<mode> may be "bio", "rq" or "mq" -- which corresponds to bio-based,
request_fn rq-based, and blk-mq rq-based respectively.
If the queue_mode feature isn't specified the default for the
"multipath" target is still "rq" but if dm_mod.use_blk_mq is set to Y
it'll default to mode "mq".
This new queue_mode feature introduces the ability for each multipath
device to have its own queue_mode (whereas before this feature all
multipath devices effectively had to have the same queue_mode).
This commit also goes a long way to eliminate the awkward (ab)use of
DM_TYPE_*, the associated filter_md_type() and other relatively fragile
and difficult to maintain code.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r-- | include/linux/device-mapper.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 0830c9e86f0d..2ce339212b6e 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -19,6 +19,14 @@ struct dm_table; | |||
19 | struct mapped_device; | 19 | struct mapped_device; |
20 | struct bio_vec; | 20 | struct bio_vec; |
21 | 21 | ||
22 | /* | ||
23 | * Type of table, mapped_device's mempool and request_queue | ||
24 | */ | ||
25 | #define DM_TYPE_NONE 0 | ||
26 | #define DM_TYPE_BIO_BASED 1 | ||
27 | #define DM_TYPE_REQUEST_BASED 2 | ||
28 | #define DM_TYPE_MQ_REQUEST_BASED 3 | ||
29 | |||
22 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | 30 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; |
23 | 31 | ||
24 | union map_info { | 32 | union map_info { |
@@ -444,6 +452,14 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
444 | void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callbacks *cb); | 452 | void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callbacks *cb); |
445 | 453 | ||
446 | /* | 454 | /* |
455 | * Target can use this to set the table's type. | ||
456 | * Can only ever be called from a target's ctr. | ||
457 | * Useful for "hybrid" target (supports both bio-based | ||
458 | * and request-based). | ||
459 | */ | ||
460 | void dm_table_set_type(struct dm_table *t, unsigned type); | ||
461 | |||
462 | /* | ||
447 | * Finally call this to make the table ready for use. | 463 | * Finally call this to make the table ready for use. |
448 | */ | 464 | */ |
449 | int dm_table_complete(struct dm_table *t); | 465 | int dm_table_complete(struct dm_table *t); |