diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-03-11 15:01:09 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-04-15 12:10:17 -0400 |
commit | 17e149b8f73ba116e71e25930dd6f2eb3828792d (patch) | |
tree | 6407112dbb113ffeebfd0620df27d4f67cd27ed1 /drivers/md/dm-table.c | |
parent | 022333427a8aa4ccb318a9db90cea4e69ca1826b (diff) |
dm: add 'use_blk_mq' module param and expose in per-device ro sysfs attr
Request-based DM's blk-mq support defaults to off; but a user can easily
change the default using the dm_mod.use_blk_mq module/boot option.
Also, you can check what mode a given request-based DM device is using
with: cat /sys/block/dm-X/dm/use_blk_mq
This change enabled further cleanup and reduced work (e.g. the
md->io_pool and md->rq_pool isn't created if using blk-mq).
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 66600cab9fa5..8d025f33de92 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -940,7 +940,7 @@ bool dm_table_mq_request_based(struct dm_table *t) | |||
940 | return dm_table_get_type(t) == DM_TYPE_MQ_REQUEST_BASED; | 940 | return dm_table_get_type(t) == DM_TYPE_MQ_REQUEST_BASED; |
941 | } | 941 | } |
942 | 942 | ||
943 | static int dm_table_alloc_md_mempools(struct dm_table *t) | 943 | static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *md) |
944 | { | 944 | { |
945 | unsigned type = dm_table_get_type(t); | 945 | unsigned type = dm_table_get_type(t); |
946 | unsigned per_bio_data_size = 0; | 946 | unsigned per_bio_data_size = 0; |
@@ -958,7 +958,7 @@ static int dm_table_alloc_md_mempools(struct dm_table *t) | |||
958 | per_bio_data_size = max(per_bio_data_size, tgt->per_bio_data_size); | 958 | per_bio_data_size = max(per_bio_data_size, tgt->per_bio_data_size); |
959 | } | 959 | } |
960 | 960 | ||
961 | t->mempools = dm_alloc_md_mempools(type, t->integrity_supported, per_bio_data_size); | 961 | t->mempools = dm_alloc_md_mempools(md, type, t->integrity_supported, per_bio_data_size); |
962 | if (!t->mempools) | 962 | if (!t->mempools) |
963 | return -ENOMEM; | 963 | return -ENOMEM; |
964 | 964 | ||
@@ -1128,7 +1128,7 @@ int dm_table_complete(struct dm_table *t) | |||
1128 | return r; | 1128 | return r; |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | r = dm_table_alloc_md_mempools(t); | 1131 | r = dm_table_alloc_md_mempools(t, t->md); |
1132 | if (r) | 1132 | if (r) |
1133 | DMERR("unable to allocate mempools"); | 1133 | DMERR("unable to allocate mempools"); |
1134 | 1134 | ||