diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-03-26 15:55:59 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-03-26 15:55:59 +0100 |
commit | 329f9052dbadf6f4afe2231668bd00c579a4aa10 (patch) | |
tree | e080a5c70df40f3ae8cf28a95a3267757668ab97 /drivers/usb/storage/scsiglue.c | |
parent | mtd/maps/pismo: remove dangling pointer and a leak (diff) | |
parent | Linux 2.6.34-rc2 (diff) | |
download | linux-329f9052dbadf6f4afe2231668bd00c579a4aa10.tar.xz linux-329f9052dbadf6f4afe2231668bd00c579a4aa10.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/mtd/nand/sh_flctl.c
Maxim's patch to initialise sysfs attributes depends on the patch which
actually adds sysfs_attr_init().
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index e5e6df39e737..4cc035562cc2 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -133,15 +133,15 @@ 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) - blk_queue_max_sectors(sdev->request_queue, + 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) { /* Tapes need much higher max_sector limits, so just * raise it to the maximum possible (4 GB / 512) and * let the queue segment size sort out the real limit. */ - blk_queue_max_sectors(sdev->request_queue, 0x7FFFFF); + blk_queue_max_hw_sectors(sdev->request_queue, 0x7FFFFF); } /* Some USB host controllers can't do DMA; they have to use PIO. @@ -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) { - blk_queue_max_sectors(sdev->request_queue, ms); - return strlen(buf); + if (sscanf(buf, "%hu", &ms) > 0) { + blk_queue_max_hw_sectors(sdev->request_queue, ms); + 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, |