• Christoph Hellwig's avatar
    libata: add translation for SCSI WRITE SAME (aka TRIM support) · 18f0f978
    Christoph Hellwig authored
    Add support for the ATA TRIM command in libata.  We translate a WRITE SAME 16
    command with the unmap bit set into an ATA TRIM command and export enough
    information in READ CAPACITY 16 and the block limits EVPD page so that the new
    SCSI layer discard support will driver this for us.
    
    Note that I hardcode the WRITE_SAME_16 opcode for now as the patch to introduce
    the symbolic is not in 2.6.32 yet but only in the SCSI tree - as soon as it is
    merged we can fix it up to properly use the symbolic name.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    18f0f978
libata-scsi.c 96.1 KB