aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r--block/blk-settings.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index a234f4bf1d6f..ea9430d3d7d2 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -125,7 +125,7 @@ void blk_set_default_limits(struct queue_limits *lim)
125 lim->alignment_offset = 0; 125 lim->alignment_offset = 0;
126 lim->io_opt = 0; 126 lim->io_opt = 0;
127 lim->misaligned = 0; 127 lim->misaligned = 0;
128 lim->no_cluster = 0; 128 lim->cluster = 1;
129} 129}
130EXPORT_SYMBOL(blk_set_default_limits); 130EXPORT_SYMBOL(blk_set_default_limits);
131 131
@@ -343,7 +343,7 @@ EXPORT_SYMBOL(blk_queue_logical_block_size);
343 * hardware can operate on without reverting to read-modify-write 343 * hardware can operate on without reverting to read-modify-write
344 * operations. 344 * operations.
345 */ 345 */
346void blk_queue_physical_block_size(struct request_queue *q, unsigned short size) 346void blk_queue_physical_block_size(struct request_queue *q, unsigned int size)
347{ 347{
348 q->limits.physical_block_size = size; 348 q->limits.physical_block_size = size;
349 349
@@ -468,15 +468,6 @@ EXPORT_SYMBOL(blk_queue_io_opt);
468void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b) 468void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b)
469{ 469{
470 blk_stack_limits(&t->limits, &b->limits, 0); 470 blk_stack_limits(&t->limits, &b->limits, 0);
471
472 if (!t->queue_lock)
473 WARN_ON_ONCE(1);
474 else if (!test_bit(QUEUE_FLAG_CLUSTER, &b->queue_flags)) {
475 unsigned long flags;
476 spin_lock_irqsave(t->queue_lock, flags);
477 queue_flag_clear(QUEUE_FLAG_CLUSTER, t);
478 spin_unlock_irqrestore(t->queue_lock, flags);
479 }
480} 471}
481EXPORT_SYMBOL(blk_queue_stack_limits); 472EXPORT_SYMBOL(blk_queue_stack_limits);
482 473
@@ -547,7 +538,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
547 t->io_min = max(t->io_min, b->io_min); 538 t->io_min = max(t->io_min, b->io_min);
548 t->io_opt = lcm(t->io_opt, b->io_opt); 539 t->io_opt = lcm(t->io_opt, b->io_opt);
549 540
550 t->no_cluster |= b->no_cluster; 541 t->cluster &= b->cluster;
551 t->discard_zeroes_data &= b->discard_zeroes_data; 542 t->discard_zeroes_data &= b->discard_zeroes_data;
552 543
553 /* Physical block size a multiple of the logical block size? */ 544 /* Physical block size a multiple of the logical block size? */
@@ -643,7 +634,6 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
643 sector_t offset) 634 sector_t offset)
644{ 635{
645 struct request_queue *t = disk->queue; 636 struct request_queue *t = disk->queue;
646 struct request_queue *b = bdev_get_queue(bdev);
647 637
648 if (bdev_stack_limits(&t->limits, bdev, offset >> 9) < 0) { 638 if (bdev_stack_limits(&t->limits, bdev, offset >> 9) < 0) {
649 char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE]; 639 char top[BDEVNAME_SIZE], bottom[BDEVNAME_SIZE];
@@ -654,17 +644,6 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
654 printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n", 644 printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n",
655 top, bottom); 645 top, bottom);
656 } 646 }
657
658 if (!t->queue_lock)
659 WARN_ON_ONCE(1);
660 else if (!test_bit(QUEUE_FLAG_CLUSTER, &b->queue_flags)) {
661 unsigned long flags;
662
663 spin_lock_irqsave(t->queue_lock, flags);
664 if (!test_bit(QUEUE_FLAG_CLUSTER, &b->queue_flags))
665 queue_flag_clear(QUEUE_FLAG_CLUSTER, t);
666 spin_unlock_irqrestore(t->queue_lock, flags);
667 }
668} 647}
669EXPORT_SYMBOL(disk_stack_limits); 648EXPORT_SYMBOL(disk_stack_limits);
670 649