linux/drivers/usb/storage
Martin K. Petersen 5db44863b6 [SCSI] sd: Implement support for WRITE SAME
Implement support for WRITE SAME(10) and WRITE SAME(16) in the SCSI disk
driver.

 - We set the default maximum to 0xFFFF because there are several
   devices out there that only support two-byte block counts even with
   WRITE SAME(16). We only enable transfers bigger than 0xFFFF if the
   device explicitly reports MAXIMUM WRITE SAME LENGTH in the BLOCK
   LIMITS VPD.

 - max_write_same_blocks can be overriden per-device basis in sysfs.

 - The UNMAP discovery heuristics remain unchanged but the discard
   limits are tweaked to match the "real" WRITE SAME commands.

 - In the error handling logic we now distinguish between WRITE SAME
   with and without UNMAP set.

The discovery process heuristics are:

 - If the device reports a SCSI level of SPC-3 or greater we'll issue
   READ SUPPORTED OPERATION CODES to find out whether WRITE SAME(16) is
   supported. If that's the case we will use it.

 - If the device supports the block limits VPD and reports a MAXIMUM
   WRITE SAME LENGTH bigger than 0xFFFF we will use WRITE SAME(16).

 - Otherwise we will use WRITE SAME(10) unless the target LBA is beyond
   0xFFFFFFFF or the block count exceeds 0xFFFF.

 - no_write_same is set for ATA, FireWire and USB.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-11-13 22:45:42 -08:00
..
alauda.c usb: remove libusual 2012-09-05 17:21:36 -07:00
cypress_atacb.c usb: remove libusual 2012-09-05 17:21:36 -07:00
datafab.c usb: remove libusual 2012-09-05 17:21:36 -07:00
debug.c
debug.h
ene_ub6250.c usb: remove libusual 2012-09-05 17:21:36 -07:00
freecom.c usb: remove libusual 2012-09-05 17:21:36 -07:00
initializers.c USB: usb-storage fails to attach to Huawei Datacard cdrom device 2009-09-23 06:46:32 -07:00
initializers.h
isd200.c usb: remove libusual 2012-09-05 17:21:36 -07:00
jumpshot.c usb: remove libusual 2012-09-05 17:21:36 -07:00
karma.c usb: remove libusual 2012-09-05 17:21:36 -07:00
Kconfig usb: remove libusual 2012-09-05 17:21:36 -07:00
Makefile usb: remove libusual 2012-09-05 17:21:36 -07:00
onetouch.c usb: remove libusual 2012-09-05 17:21:36 -07:00
option_ms.c usb: Add module.h to drivers/usb consumers who really use it. 2011-10-31 19:31:25 -04:00
option_ms.h USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
protocol.c USB: storage: fixed space issues in coding style. 2012-06-13 15:30:38 -07:00
protocol.h USB: usb-storage: merge ATAPI and QIC-157 protocol routines 2009-01-07 09:59:57 -08:00
realtek_cr.c usb: remove libusual 2012-09-05 17:21:36 -07:00
scsiglue.c [SCSI] sd: Implement support for WRITE SAME 2012-11-13 22:45:42 -08:00
scsiglue.h
sddr09.c usb: remove libusual 2012-09-05 17:21:36 -07:00
sddr55.c usb: remove libusual 2012-09-05 17:21:36 -07:00
shuttle_usbat.c usb: remove libusual 2012-09-05 17:21:36 -07:00
sierra_ms.c USB: sierra_ms: don't keep unused variable 2012-09-21 09:50:02 -07:00
sierra_ms.h
transport.c usb: convert USB_QUIRK_RESET_MORPHS to USB_QUIRK_RESET 2012-08-20 14:38:08 -07:00
transport.h usb/storage: a couple defines from drivers/usb/storage/transport.h to include/linux/usb/storage.h 2012-02-28 11:05:18 -08:00
uas.c USB: uas: fix gcc warning 2012-09-26 14:13:19 -07:00
unusual_alauda.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_cypress.h USB: usb-storage: unusual_devs update for Cypress ATACB 2011-01-22 18:31:26 -08:00
unusual_datafab.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_devs.h usb-storage: add unusual_devs entry for Casio EX-N1 digital camera 2012-10-24 15:00:11 -07:00
unusual_ene_ub6250.h Staging: Merge ENE UB6250 SD card codes from keucr to drivers/usb/storage 2011-03-07 13:40:59 -08:00
unusual_freecom.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_isd200.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_jumpshot.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_karma.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_onetouch.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_realtek.h usb-storage: fix up the unusual_realtek device list 2011-05-17 11:56:28 -07:00
unusual_sddr09.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_sddr55.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_usbat.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
usb.c usb: remove libusual 2012-09-05 17:21:36 -07:00
usb.h usb-storage: fix freezing of the scanning thread 2012-02-21 16:29:15 -08:00
usual-tables.c usb: remove libusual 2012-09-05 17:21:36 -07:00