aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2012-01-11 10:27:11 -0500
committerJens Axboe <axboe@kernel.dk>2012-01-11 10:27:11 -0500
commitb1bd055d397e09f99dcef9b138ed104ff1812fcb (patch)
treee8e1d3d0b6a33859392bcba516933aff256dc4b4 /drivers/md
parentc98b2cc29af8e84e7364b53e9bb4cc7cfaf62555 (diff)
block: Introduce blk_set_stacking_limits function
Stacking driver queue limits are typically bounded exclusively by the capabilities of the low level devices, not by the stacking driver itself. This patch introduces blk_set_stacking_limits() which has more liberal metrics than the default queue limits function. This allows us to inherit topology parameters from bottom devices without manually tweaking the default limits in each driver prior to calling the stacking function. Since there is now a clear distinction between stacking and low-level devices, blk_set_default_limits() has been modified to carry the more conservative values that we used to manually set in blk_queue_make_request(). Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-table.c6
-rw-r--r--drivers/md/md.c1
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 8e9132130142..63cc54289aff 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -699,7 +699,7 @@ static int validate_hardware_logical_block_alignment(struct dm_table *table,
699 while (i < dm_table_get_num_targets(table)) { 699 while (i < dm_table_get_num_targets(table)) {
700 ti = dm_table_get_target(table, i++); 700 ti = dm_table_get_target(table, i++);
701 701
702 blk_set_default_limits(&ti_limits); 702 blk_set_stacking_limits(&ti_limits);
703 703
704 /* combine all target devices' limits */ 704 /* combine all target devices' limits */
705 if (ti->type->iterate_devices) 705 if (ti->type->iterate_devices)
@@ -1221,10 +1221,10 @@ int dm_calculate_queue_limits(struct dm_table *table,
1221 struct queue_limits ti_limits; 1221 struct queue_limits ti_limits;
1222 unsigned i = 0; 1222 unsigned i = 0;
1223 1223
1224 blk_set_default_limits(limits); 1224 blk_set_stacking_limits(limits);
1225 1225
1226 while (i < dm_table_get_num_targets(table)) { 1226 while (i < dm_table_get_num_targets(table)) {
1227 blk_set_default_limits(&ti_limits); 1227 blk_set_stacking_limits(&ti_limits);
1228 1228
1229 ti = dm_table_get_target(table, i++); 1229 ti = dm_table_get_target(table, i++);
1230 1230
diff --git a/drivers/md/md.c b/drivers/md/md.c
index ee981737edfc..114ba155af87 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4622,6 +4622,7 @@ static int md_alloc(dev_t dev, char *name)
4622 mddev->queue->queuedata = mddev; 4622 mddev->queue->queuedata = mddev;
4623 4623
4624 blk_queue_make_request(mddev->queue, md_make_request); 4624 blk_queue_make_request(mddev->queue, md_make_request);
4625 blk_set_stacking_limits(&mddev->queue->limits);
4625 4626
4626 disk = alloc_disk(1 << shift); 4627 disk = alloc_disk(1 << shift);
4627 if (!disk) { 4628 if (!disk) {