Skip to content

Commit

Permalink
block: Rename blk_queue_max_sectors to blk_queue_max_hw_sectors
Browse files Browse the repository at this point in the history
The block layer calling convention is blk_queue_<limit name>.
blk_queue_max_sectors predates this practice, leading to some confusion.
Rename the function to appropriately reflect that its intended use is to
set max_hw_sectors.

Also introduce a temporary wrapper for backwards compability.  This can
be removed after the merge window is closed.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
martinkpetersen authored and Jens Axboe committed Feb 26, 2010
1 parent eb28d31 commit 086fa5f
Show file tree
Hide file tree
Showing 41 changed files with 60 additions and 53 deletions.
2 changes: 1 addition & 1 deletion arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
ubd_dev->fd = fd;

if(ubd_dev->cow.file != NULL){
blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long));
blk_queue_max_hw_sectors(ubd_dev->queue, 8 * sizeof(long));

err = -ENOMEM;
ubd_dev->cow.bitmap = vmalloc(ubd_dev->cow.bitmap_len);
Expand Down
8 changes: 4 additions & 4 deletions block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
q->unplug_timer.data = (unsigned long)q;

blk_set_default_limits(&q->limits);
blk_queue_max_sectors(q, BLK_SAFE_MAX_SECTORS);
blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);

/*
* If the caller didn't supply a lock, fall back to our embedded
Expand Down Expand Up @@ -210,7 +210,7 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_mask)
EXPORT_SYMBOL(blk_queue_bounce_limit);

/**
* blk_queue_max_sectors - set max sectors for a request for this queue
* blk_queue_max_hw_sectors - set max sectors for a request for this queue
* @q: the request queue for the device
* @max_hw_sectors: max hardware sectors in the usual 512b unit
*
Expand All @@ -225,7 +225,7 @@ EXPORT_SYMBOL(blk_queue_bounce_limit);
* per-device basis in /sys/block/<device>/queue/max_sectors_kb.
* The soft limit can not exceed max_hw_sectors.
**/
void blk_queue_max_sectors(struct request_queue *q, unsigned int max_hw_sectors)
void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
{
if ((max_hw_sectors << 9) < PAGE_CACHE_SIZE) {
max_hw_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
Expand All @@ -237,7 +237,7 @@ void blk_queue_max_sectors(struct request_queue *q, unsigned int max_hw_sectors)
q->limits.max_sectors = min_t(unsigned int, max_hw_sectors,
BLK_DEF_MAX_SECTORS);
}
EXPORT_SYMBOL(blk_queue_max_sectors);
EXPORT_SYMBOL(blk_queue_max_hw_sectors);

/**
* blk_queue_max_discard_sectors - set max sectors for a single discard
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
dev->flags |= ATA_DFLAG_NO_UNLOAD;

/* configure max sectors */
blk_queue_max_sectors(sdev->request_queue, dev->max_sectors);
blk_queue_max_hw_sectors(sdev->request_queue, dev->max_sectors);

if (dev->class == ATA_DEV_ATAPI) {
struct request_queue *q = sdev->request_queue;
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/DAC960.c
Original file line number Diff line number Diff line change
Expand Up @@ -2535,7 +2535,7 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
RequestQueue->queuedata = Controller;
blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit);
blk_queue_max_phys_segments(RequestQueue, Controller->DriverScatterGatherLimit);
blk_queue_max_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
disk->queue = RequestQueue;
sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n);
disk->major = MajorNumber;
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ static struct brd_device *brd_alloc(int i)
goto out_free_dev;
blk_queue_make_request(brd->brd_queue, brd_make_request);
blk_queue_ordered(brd->brd_queue, QUEUE_ORDERED_TAG, NULL);
blk_queue_max_sectors(brd->brd_queue, 1024);
blk_queue_max_hw_sectors(brd->brd_queue, 1024);
blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY);

disk = brd->brd_disk = alloc_disk(1 << part_shift);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
/* This is a limit in the driver and could be eliminated. */
blk_queue_max_phys_segments(disk->queue, h->maxsgentries);

blk_queue_max_sectors(disk->queue, h->cciss_max_sectors);
blk_queue_max_hw_sectors(disk->queue, h->cciss_max_sectors);

blk_queue_softirq_done(disk->queue, cciss_softirq_done);

Expand Down
2 changes: 1 addition & 1 deletion drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int max_seg_s) __mu

max_seg_s = min(queue_max_sectors(b) * queue_logical_block_size(b), max_seg_s);

blk_queue_max_sectors(q, max_seg_s >> 9);
blk_queue_max_hw_sectors(q, max_seg_s >> 9);
blk_queue_max_phys_segments(q, max_segments ? max_segments : MAX_PHYS_SEGMENTS);
blk_queue_max_hw_segments(q, max_segments ? max_segments : MAX_HW_SEGMENTS);
blk_queue_max_segment_size(q, max_seg_s);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4234,7 +4234,7 @@ static int __init floppy_init(void)
err = -ENOMEM;
goto out_unreg_driver;
}
blk_queue_max_sectors(floppy_queue, 64);
blk_queue_max_hw_sectors(floppy_queue, 64);

blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE,
floppy_find, NULL, NULL);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static int __init hd_init(void)
return -ENOMEM;
}

blk_queue_max_sectors(hd_queue, 255);
blk_queue_max_hw_sectors(hd_queue, 255);
init_timer(&device_timer);
device_timer.function = hd_times_out;
blk_queue_logical_block_size(hd_queue, 512);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/mg_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ static int mg_probe(struct platform_device *plat_dev)
__func__, __LINE__);
goto probe_err_6;
}
blk_queue_max_sectors(host->breq, MG_MAX_SECTS);
blk_queue_max_hw_sectors(host->breq, MG_MAX_SECTS);
blk_queue_logical_block_size(host->breq, MG_SECTOR_SIZE);

init_timer(&host->timer);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ static int __init pd_init(void)
if (!pd_queue)
goto out1;

blk_queue_max_sectors(pd_queue, cluster);
blk_queue_max_hw_sectors(pd_queue, cluster);

if (register_blkdev(major, name))
goto out2;
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write)
* even if the size is a multiple of the packet size.
*/
spin_lock_irq(q->queue_lock);
blk_queue_max_sectors(q, pd->settings.size);
blk_queue_max_hw_sectors(q, pd->settings.size);
spin_unlock_irq(q->queue_lock);
set_bit(PACKET_WRITABLE, &pd->flags);
} else {
Expand Down Expand Up @@ -2613,7 +2613,7 @@ static void pkt_init_queue(struct pktcdvd_device *pd)

blk_queue_make_request(q, pkt_make_request);
blk_queue_logical_block_size(q, CD_FRAMESIZE);
blk_queue_max_sectors(q, PACKET_MAX_SECTORS);
blk_queue_max_hw_sectors(q, PACKET_MAX_SECTORS);
blk_queue_merge_bvec(q, pkt_merge_bvec);
q->queuedata = pd;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ps3disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)

blk_queue_bounce_limit(queue, BLK_BOUNCE_HIGH);

blk_queue_max_sectors(queue, dev->bounce_size >> 9);
blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9);
blk_queue_segment_boundary(queue, -1UL);
blk_queue_dma_alignment(queue, dev->blk_size-1);
blk_queue_logical_block_size(queue, dev->blk_size);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ps3vram.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
blk_queue_max_phys_segments(queue, MAX_PHYS_SEGMENTS);
blk_queue_max_hw_segments(queue, MAX_HW_SEGMENTS);
blk_queue_max_segment_size(queue, BLK_MAX_SEGMENT_SIZE);
blk_queue_max_sectors(queue, BLK_SAFE_MAX_SECTORS);
blk_queue_max_hw_sectors(queue, BLK_SAFE_MAX_SECTORS);

gendisk = alloc_disk(1);
if (!gendisk) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/sunvdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ static int probe_disk(struct vdc_port *port)

blk_queue_max_hw_segments(q, port->ring_cookies);
blk_queue_max_phys_segments(q, port->ring_cookies);
blk_queue_max_sectors(q, port->max_xfer_size);
blk_queue_max_hw_sectors(q, port->max_xfer_size);
g->major = vdc_major;
g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
strcpy(g->disk_name, port->disk_name);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2323,7 +2323,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
blk_queue_max_hw_segments(q, UB_MAX_REQ_SG);
blk_queue_max_phys_segments(q, UB_MAX_REQ_SG);
blk_queue_segment_boundary(q, 0xffffffff); /* Dubious. */
blk_queue_max_sectors(q, UB_MAX_SECTORS);
blk_queue_max_hw_sectors(q, UB_MAX_SECTORS);
blk_queue_logical_block_size(q, lun->capacity.bsize);

lun->disk = disk;
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/viodasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static int probe_disk(struct viodasd_device *d)
d->disk = g;
blk_queue_max_hw_segments(q, VIOMAXBLOCKDMA);
blk_queue_max_phys_segments(q, VIOMAXBLOCKDMA);
blk_queue_max_sectors(q, VIODASD_MAXSECTORS);
blk_queue_max_hw_sectors(q, VIODASD_MAXSECTORS);
g->major = VIODASD_MAJOR;
g->first_minor = dev_no << PARTITION_SHIFT;
if (dev_no >= 26)
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/xd.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static int __init xd_init(void)
}

/* xd_maxsectors depends on controller - so set after detection */
blk_queue_max_sectors(xd_queue, xd_maxsectors);
blk_queue_max_hw_sectors(xd_queue, xd_maxsectors);

for (i = 0; i < xd_drives; i++)
add_disk(xd_gendisk[i]);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size)

/* Hard sector size and max sectors impersonate the equiv. hardware. */
blk_queue_logical_block_size(rq, sector_size);
blk_queue_max_sectors(rq, 512);
blk_queue_max_hw_sectors(rq, 512);

/* Each segment in a request is up to an aligned page in size. */
blk_queue_segment_boundary(rq, PAGE_SIZE - 1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/viocd.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
sizeof(gendisk->disk_name));
blk_queue_max_hw_segments(q, 1);
blk_queue_max_phys_segments(q, 1);
blk_queue_max_sectors(q, 4096 / 512);
blk_queue_max_hw_sectors(q, 4096 / 512);
gendisk->queue = q;
gendisk->fops = &viocd_fops;
gendisk->flags = GENHD_FL_CD|GENHD_FL_REMOVABLE;
Expand Down
2 changes: 1 addition & 1 deletion drivers/firewire/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
sdev->start_stop_pwr_cond = 1;

if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512);
blk_queue_max_hw_sectors(sdev->request_queue, 128 * 1024 / 512);

blk_queue_max_segment_size(sdev->request_queue, SBP2_MAX_SEG_SIZE);

Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static void ide_disk_setup(ide_drive_t *drive)
if (max_s > hwif->rqsize)
max_s = hwif->rqsize;

blk_queue_max_sectors(q, max_s);
blk_queue_max_hw_sectors(q, max_s);
}

printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name,
Expand Down
4 changes: 2 additions & 2 deletions drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ static void ide_floppy_setup(ide_drive_t *drive)
drive->atapi_flags |= IDE_AFLAG_ZIP_DRIVE;
/* This value will be visible in the /proc/ide/hdx/settings */
drive->pc_delay = IDEFLOPPY_PC_DELAY;
blk_queue_max_sectors(drive->queue, 64);
blk_queue_max_hw_sectors(drive->queue, 64);
}

/*
* Guess what? The IOMEGA Clik! drive also needs the above fix. It makes
* nasty clicking noises without it, so please don't remove this.
*/
if (strncmp((char *)&id[ATA_ID_PROD], "IOMEGA Clik!", 11) == 0) {
blk_queue_max_sectors(drive->queue, 64);
blk_queue_max_hw_sectors(drive->queue, 64);
drive->atapi_flags |= IDE_AFLAG_CLIK_DRIVE;
/* IOMEGA Clik! drives do not support lock/unlock commands */
drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ static int ide_init_queue(ide_drive_t *drive)

if (hwif->rqsize < max_sectors)
max_sectors = hwif->rqsize;
blk_queue_max_sectors(q, max_sectors);
blk_queue_max_hw_sectors(q, max_sectors);

#ifdef CONFIG_PCI
/* When we have an IOMMU, we may have a problem where pci_map_sg()
Expand Down
2 changes: 1 addition & 1 deletion drivers/ieee1394/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
if (lu->workarounds & SBP2_WORKAROUND_POWER_CONDITION)
sdev->start_stop_pwr_cond = 1;
if (lu->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512);
blk_queue_max_hw_sectors(sdev->request_queue, 128 * 1024 / 512);

blk_queue_max_segment_size(sdev->request_queue, SBP2_MAX_SEG_SIZE);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
*/
if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

conf->array_sectors += rdev->sectors;
cnt++;
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
*/
if (q->merge_bvec_fn &&
queue_max_sectors(q) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

conf->working_disks++;
mddev->degraded--;
Expand Down Expand Up @@ -478,7 +478,7 @@ static int multipath_run (mddev_t *mddev)
* a merge_bvec_fn to be involved in multipath */
if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

if (!test_bit(Faulty, &rdev->flags))
conf->working_disks++;
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static int create_strip_zones(mddev_t *mddev)

if (rdev1->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

if (!smallest || (rdev1->sectors < smallest->sectors))
smallest = rdev1;
Expand Down Expand Up @@ -325,7 +325,7 @@ static int raid0_run(mddev_t *mddev)
}
if (md_check_no_bitmap(mddev))
return -EINVAL;
blk_queue_max_sectors(mddev->queue, mddev->chunk_sectors);
blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
mddev->queue->queue_lock = &mddev->queue->__queue_lock;

ret = create_strip_zones(mddev);
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
*/
if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

p->head_position = 0;
rdev->raid_disk = mirror;
Expand Down Expand Up @@ -2103,7 +2103,7 @@ static int run(mddev_t *mddev)
*/
if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);
}

mddev->degraded = 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
*/
if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

p->head_position = 0;
rdev->raid_disk = mirror;
Expand Down Expand Up @@ -2260,7 +2260,7 @@ static int run(mddev_t *mddev)
*/
if (rdev->bdev->bd_disk->queue->merge_bvec_fn &&
queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);
blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);

disk->head_position = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/memstick/core/mspro_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
blk_queue_prep_rq(msb->queue, mspro_block_prepare_req);

blk_queue_bounce_limit(msb->queue, limit);
blk_queue_max_sectors(msb->queue, MSPRO_BLOCK_MAX_PAGES);
blk_queue_max_hw_sectors(msb->queue, MSPRO_BLOCK_MAX_PAGES);
blk_queue_max_phys_segments(msb->queue, MSPRO_BLOCK_MAX_SEGS);
blk_queue_max_hw_segments(msb->queue, MSPRO_BLOCK_MAX_SEGS);
blk_queue_max_segment_size(msb->queue,
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/i2o/i2o_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ static int i2o_block_probe(struct device *dev)
queue->queuedata = i2o_blk_dev;

blk_queue_max_phys_segments(queue, I2O_MAX_PHYS_SEGMENTS);
blk_queue_max_sectors(queue, max_sectors);
blk_queue_max_hw_sectors(queue, max_sectors);
blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size));

osm_debug("max sectors = %d\n", queue->max_sectors);
Expand Down
4 changes: 2 additions & 2 deletions drivers/mmc/card/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock

if (mq->bounce_buf) {
blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_ANY);
blk_queue_max_sectors(mq->queue, bouncesz / 512);
blk_queue_max_hw_sectors(mq->queue, bouncesz / 512);
blk_queue_max_phys_segments(mq->queue, bouncesz / 512);
blk_queue_max_hw_segments(mq->queue, bouncesz / 512);
blk_queue_max_segment_size(mq->queue, bouncesz);
Expand All @@ -180,7 +180,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock

if (!mq->bounce_buf) {
blk_queue_bounce_limit(mq->queue, limit);
blk_queue_max_sectors(mq->queue,
blk_queue_max_hw_sectors(mq->queue,
min(host->max_blk_count, host->max_req_size / 512));
blk_queue_max_phys_segments(mq->queue, host->max_phys_segs);
blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@ static void dasd_setup_queue(struct dasd_block *block)

blk_queue_logical_block_size(block->request_queue, block->bp_block);
max = block->base->discipline->max_blocks << block->s2b_shift;
blk_queue_max_sectors(block->request_queue, max);
blk_queue_max_hw_sectors(block->request_queue, max);
blk_queue_max_phys_segments(block->request_queue, -1L);
blk_queue_max_hw_segments(block->request_queue, -1L);
/* with page sized segments we can translate each segement into
Expand Down
Loading

0 comments on commit 086fa5f

Please sign in to comment.