• Martin K. Petersen's avatar
    [SCSI] sd: Implement support for WRITE SAME · 5db44863
    Martin K. Petersen authored
    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: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
    Reviewed-by: default avatarJeff Garzik <jgarzik@redhat.com>
    Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
    5db44863
Name
Last commit
Last update
..
fc Loading commit data...
Kbuild Loading commit data...
fc_encode.h Loading commit data...
fc_frame.h Loading commit data...
fcoe_sysfs.h Loading commit data...
iscsi_if.h Loading commit data...
iscsi_proto.h Loading commit data...
libfc.h Loading commit data...
libfcoe.h Loading commit data...
libiscsi.h Loading commit data...
libiscsi_tcp.h Loading commit data...
libsas.h Loading commit data...
libsrp.h Loading commit data...
osd_attributes.h Loading commit data...
osd_initiator.h Loading commit data...
osd_ore.h Loading commit data...
osd_protocol.h Loading commit data...
osd_sec.h Loading commit data...
osd_sense.h Loading commit data...
osd_types.h Loading commit data...
sas.h Loading commit data...
sas_ata.h Loading commit data...
scsi.h Loading commit data...
scsi_bsg_fc.h Loading commit data...
scsi_bsg_iscsi.h Loading commit data...
scsi_cmnd.h Loading commit data...
scsi_dbg.h Loading commit data...
scsi_device.h Loading commit data...
scsi_devinfo.h Loading commit data...
scsi_dh.h Loading commit data...
scsi_driver.h Loading commit data...
scsi_eh.h Loading commit data...
scsi_host.h Loading commit data...
scsi_ioctl.h Loading commit data...
scsi_netlink.h Loading commit data...
scsi_netlink_fc.h Loading commit data...
scsi_tcq.h Loading commit data...
scsi_tgt.h Loading commit data...
scsi_tgt_if.h Loading commit data...
scsi_transport.h Loading commit data...
scsi_transport_fc.h Loading commit data...
scsi_transport_iscsi.h Loading commit data...
scsi_transport_sas.h Loading commit data...
scsi_transport_spi.h Loading commit data...
scsi_transport_srp.h Loading commit data...
scsicam.h Loading commit data...
sg.h Loading commit data...
srp.h Loading commit data...