Commit 953923c0 authored by Mike Snitzer's avatar Mike Snitzer

dm: rename DM_TYPE_MQ_REQUEST_BASED to DM_TYPE_REQUEST_BASED

Now that request-based DM is only using blk-mq, there is no need to
differentiate between legacy "rq" and new "mq".  We're back to a single
request-based DM -- and there was much rejoicing!
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 6a23e05c
...@@ -203,7 +203,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti) ...@@ -203,7 +203,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti)
static int alloc_multipath_stage2(struct dm_target *ti, struct multipath *m) static int alloc_multipath_stage2(struct dm_target *ti, struct multipath *m)
{ {
if (m->queue_mode == DM_TYPE_NONE) { if (m->queue_mode == DM_TYPE_NONE) {
m->queue_mode = DM_TYPE_MQ_REQUEST_BASED; m->queue_mode = DM_TYPE_REQUEST_BASED;
} else if (m->queue_mode == DM_TYPE_BIO_BASED) { } else if (m->queue_mode == DM_TYPE_BIO_BASED) {
INIT_WORK(&m->process_queued_bios, process_queued_bios); INIT_WORK(&m->process_queued_bios, process_queued_bios);
/* /*
...@@ -658,7 +658,7 @@ static int multipath_map_bio(struct dm_target *ti, struct bio *bio) ...@@ -658,7 +658,7 @@ static int multipath_map_bio(struct dm_target *ti, struct bio *bio)
static void process_queued_io_list(struct multipath *m) static void process_queued_io_list(struct multipath *m)
{ {
if (m->queue_mode == DM_TYPE_MQ_REQUEST_BASED) if (m->queue_mode == DM_TYPE_REQUEST_BASED)
dm_mq_kick_requeue_list(dm_table_get_md(m->ti->table)); dm_mq_kick_requeue_list(dm_table_get_md(m->ti->table));
else if (m->queue_mode == DM_TYPE_BIO_BASED) else if (m->queue_mode == DM_TYPE_BIO_BASED)
queue_work(kmultipathd, &m->process_queued_bios); queue_work(kmultipathd, &m->process_queued_bios);
...@@ -1079,10 +1079,9 @@ static int parse_features(struct dm_arg_set *as, struct multipath *m) ...@@ -1079,10 +1079,9 @@ static int parse_features(struct dm_arg_set *as, struct multipath *m)
if (!strcasecmp(queue_mode_name, "bio")) if (!strcasecmp(queue_mode_name, "bio"))
m->queue_mode = DM_TYPE_BIO_BASED; m->queue_mode = DM_TYPE_BIO_BASED;
else if (!strcasecmp(queue_mode_name, "rq")) else if (!strcasecmp(queue_mode_name, "rq") ||
!strcasecmp(queue_mode_name, "mq"))
m->queue_mode = DM_TYPE_REQUEST_BASED; m->queue_mode = DM_TYPE_REQUEST_BASED;
else if (!strcasecmp(queue_mode_name, "mq"))
m->queue_mode = DM_TYPE_MQ_REQUEST_BASED;
else { else {
ti->error = "Unknown 'queue_mode' requested"; ti->error = "Unknown 'queue_mode' requested";
r = -EINVAL; r = -EINVAL;
...@@ -1716,9 +1715,6 @@ static void multipath_status(struct dm_target *ti, status_type_t type, ...@@ -1716,9 +1715,6 @@ static void multipath_status(struct dm_target *ti, status_type_t type,
case DM_TYPE_BIO_BASED: case DM_TYPE_BIO_BASED:
DMEMIT("queue_mode bio "); DMEMIT("queue_mode bio ");
break; break;
case DM_TYPE_MQ_REQUEST_BASED:
DMEMIT("queue_mode mq ");
break;
default: default:
WARN_ON_ONCE(true); WARN_ON_ONCE(true);
break; break;
...@@ -1962,7 +1958,7 @@ static int multipath_busy(struct dm_target *ti) ...@@ -1962,7 +1958,7 @@ static int multipath_busy(struct dm_target *ti)
/* no paths available, for blk-mq: rely on IO mapping to delay requeue */ /* no paths available, for blk-mq: rely on IO mapping to delay requeue */
if (!atomic_read(&m->nr_valid_paths) && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) if (!atomic_read(&m->nr_valid_paths) && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))
return (m->queue_mode != DM_TYPE_MQ_REQUEST_BASED); return (m->queue_mode != DM_TYPE_REQUEST_BASED);
/* Guess which priority_group will be used at next mapping time */ /* Guess which priority_group will be used at next mapping time */
pg = READ_ONCE(m->current_pg); pg = READ_ONCE(m->current_pg);
......
...@@ -871,8 +871,7 @@ static bool __table_type_bio_based(enum dm_queue_mode table_type) ...@@ -871,8 +871,7 @@ static bool __table_type_bio_based(enum dm_queue_mode table_type)
static bool __table_type_request_based(enum dm_queue_mode table_type) static bool __table_type_request_based(enum dm_queue_mode table_type)
{ {
return (table_type == DM_TYPE_REQUEST_BASED || return table_type == DM_TYPE_REQUEST_BASED;
table_type == DM_TYPE_MQ_REQUEST_BASED);
} }
void dm_table_set_type(struct dm_table *t, enum dm_queue_mode type) void dm_table_set_type(struct dm_table *t, enum dm_queue_mode type)
...@@ -986,10 +985,6 @@ static int dm_table_determine_type(struct dm_table *t) ...@@ -986,10 +985,6 @@ static int dm_table_determine_type(struct dm_table *t)
BUG_ON(!request_based); /* No targets in this table */ BUG_ON(!request_based); /* No targets in this table */
/*
* The only way to establish DM_TYPE_MQ_REQUEST_BASED is by
* having a compatible target use dm_table_set_type.
*/
t->type = DM_TYPE_REQUEST_BASED; t->type = DM_TYPE_REQUEST_BASED;
verify_rq_based: verify_rq_based:
......
...@@ -2213,7 +2213,6 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) ...@@ -2213,7 +2213,6 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t)
switch (type) { switch (type) {
case DM_TYPE_REQUEST_BASED: case DM_TYPE_REQUEST_BASED:
case DM_TYPE_MQ_REQUEST_BASED:
r = dm_mq_init_request_queue(md, t); r = dm_mq_init_request_queue(md, t);
if (r) { if (r) {
DMERR("Cannot initialize queue for request-based dm-mq mapped device"); DMERR("Cannot initialize queue for request-based dm-mq mapped device");
...@@ -2946,7 +2945,6 @@ struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, enum dm_qu ...@@ -2946,7 +2945,6 @@ struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, enum dm_qu
goto out; goto out;
break; break;
case DM_TYPE_REQUEST_BASED: case DM_TYPE_REQUEST_BASED:
case DM_TYPE_MQ_REQUEST_BASED:
pool_size = max(dm_get_reserved_rq_based_ios(), min_pool_size); pool_size = max(dm_get_reserved_rq_based_ios(), min_pool_size);
front_pad = offsetof(struct dm_rq_clone_bio_info, clone); front_pad = offsetof(struct dm_rq_clone_bio_info, clone);
/* per_io_data_size is used for blk-mq pdu at queue allocation */ /* per_io_data_size is used for blk-mq pdu at queue allocation */
......
...@@ -26,9 +26,8 @@ enum dm_queue_mode { ...@@ -26,9 +26,8 @@ enum dm_queue_mode {
DM_TYPE_NONE = 0, DM_TYPE_NONE = 0,
DM_TYPE_BIO_BASED = 1, DM_TYPE_BIO_BASED = 1,
DM_TYPE_REQUEST_BASED = 2, DM_TYPE_REQUEST_BASED = 2,
DM_TYPE_MQ_REQUEST_BASED = 3, DM_TYPE_DAX_BIO_BASED = 3,
DM_TYPE_DAX_BIO_BASED = 4, DM_TYPE_NVME_BIO_BASED = 4,
DM_TYPE_NVME_BIO_BASED = 5,
}; };
typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment