usb-storage: use max_hw_sectors instead of max_sectors
[safe/jmp/linux-2.6] / drivers / usb / storage / scsiglue.c
index aadc16b..4cc0355 100644 (file)
@@ -133,7 +133,7 @@ static int slave_configure(struct scsi_device *sdev)
 
                if (us->fflags & US_FL_MAX_SECTORS_MIN)
                        max_sectors = PAGE_CACHE_SIZE >> 9;
-               if (queue_max_sectors(sdev->request_queue) > max_sectors)
+               if (queue_max_hw_sectors(sdev->request_queue) > max_sectors)
                        blk_queue_max_hw_sectors(sdev->request_queue,
                                              max_sectors);
        } else if (sdev->type == TYPE_TAPE) {
@@ -484,7 +484,7 @@ static ssize_t show_max_sectors(struct device *dev, struct device_attribute *att
 {
        struct scsi_device *sdev = to_scsi_device(dev);
 
-       return sprintf(buf, "%u\n", queue_max_sectors(sdev->request_queue));
+       return sprintf(buf, "%u\n", queue_max_hw_sectors(sdev->request_queue));
 }
 
 /* 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
        struct scsi_device *sdev = to_scsi_device(dev);
        unsigned short ms;
 
-       if (sscanf(buf, "%hu", &ms) > 0 && ms <= SCSI_DEFAULT_MAX_SECTORS) {
+       if (sscanf(buf, "%hu", &ms) > 0) {
                blk_queue_max_hw_sectors(sdev->request_queue, ms);
-               return strlen(buf);
+               return count;
        }
        return -EINVAL; 
 }
@@ -539,7 +539,7 @@ struct scsi_host_template usb_stor_host_template = {
        .slave_configure =              slave_configure,
 
        /* lots of sg segments can be handled */
-       .sg_tablesize =                 SG_ALL,
+       .sg_tablesize =                 SCSI_MAX_SG_CHAIN_SEGMENTS,
 
        /* limit the total size of a transfer to 120 KB */
        .max_sectors =                  240,