• Martin K. Petersen's avatar
    [SCSI] sd: Logical Block Provisioning update · c98a0eb0
    Martin K. Petersen authored
    SBC3r26 contains many changes to the Logical Block Provisioning
    interfaces (formerly known as Thin Provisioning ditto). This patch
    implements support for both the old and new schemes using the same
    heuristic as before (whether the LBP VPD page is present).
    
    The new code also allows the provisioning mode (i.e. choice of command)
    to be overridden on a per-device basis via sysfs. Two additional modes
    are supported in this version:
    
     - WRITE SAME(10) with the UNMAP bit set
    
     - WRITE SAME(10) without the UNMAP bit set. This allows us to support
       devices that predate the TP/LBP enhancements in SBC3 and which work
       by way zero-detection
    
    Switching between modes has been consolidated in a helper function that
    also updates the block layer topology according to the limitations of
    the chosen command.
    
    I experimented with trying WRITE SAME(16) if UNMAP fails, WRITE SAME(10)
    if WRITE SAME(16) fails, etc. but found several devices that got
    cranky. So for now we'll disable discard if one of the commands
    fail. The user still has the option of selecting a different mode in
    sysfs.
    Signed-off-by: Martin K. Petersen's avatarMartin K. Petersen <[email protected]>
    Signed-off-by: default avatarJames Bottomley <[email protected]>
    c98a0eb0
sd.h 3.87 KB