aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/storage/scsiglue.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index aadc16b5eed7..4cc035562cc2 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -133,7 +133,7 @@ static int slave_configure(struct scsi_device *sdev)
133 133
134 if (us->fflags & US_FL_MAX_SECTORS_MIN) 134 if (us->fflags & US_FL_MAX_SECTORS_MIN)
135 max_sectors = PAGE_CACHE_SIZE >> 9; 135 max_sectors = PAGE_CACHE_SIZE >> 9;
136 if (queue_max_sectors(sdev->request_queue) > max_sectors) 136 if (queue_max_hw_sectors(sdev->request_queue) > max_sectors)
137 blk_queue_max_hw_sectors(sdev->request_queue, 137 blk_queue_max_hw_sectors(sdev->request_queue,
138 max_sectors); 138 max_sectors);
139 } else if (sdev->type == TYPE_TAPE) { 139 } else if (sdev->type == TYPE_TAPE) {
@@ -484,7 +484,7 @@ static ssize_t show_max_sectors(struct device *dev, struct device_attribute *att
484{ 484{
485 struct scsi_device *sdev = to_scsi_device(dev); 485 struct scsi_device *sdev = to_scsi_device(dev);
486 486
487 return sprintf(buf, "%u\n", queue_max_sectors(sdev->request_queue)); 487 return sprintf(buf, "%u\n", queue_max_hw_sectors(sdev->request_queue));
488} 488}
489 489
490/* Input routine for the sysfs max_sectors file */ 490/* Input routine for the sysfs max_sectors file */
@@ -494,9 +494,9 @@ static ssize_t store_max_sectors(struct device *dev, struct device_attribute *at
494 struct scsi_device *sdev = to_scsi_device(dev); 494 struct scsi_device *sdev = to_scsi_device(dev);
495 unsigned short ms; 495 unsigned short ms;
496 496
497 if (sscanf(buf, "%hu", &ms) > 0 && ms <= SCSI_DEFAULT_MAX_SECTORS) { 497 if (sscanf(buf, "%hu", &ms) > 0) {
498 blk_queue_max_hw_sectors(sdev->request_queue, ms); 498 blk_queue_max_hw_sectors(sdev->request_queue, ms);
499 return strlen(buf); 499 return count;
500 } 500 }
501 return -EINVAL; 501 return -EINVAL;
502} 502}
@@ -539,7 +539,7 @@ struct scsi_host_template usb_stor_host_template = {
539 .slave_configure = slave_configure, 539 .slave_configure = slave_configure,
540 540
541 /* lots of sg segments can be handled */ 541 /* lots of sg segments can be handled */
542 .sg_tablesize = SG_ALL, 542 .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS,
543 543
544 /* limit the total size of a transfer to 120 KB */ 544 /* limit the total size of a transfer to 120 KB */
545 .max_sectors = 240, 545 .max_sectors = 240,