[SCSI] scsi_debug: fix logical block provisioning support
provisioning map (map_storep) is a bitmap accessed by bitops.
So the allocation size should be a multiple of sizeof(unsigned long) and
also the bitmap should be cleared by using bitmap_clear() instead of
memset().
Otherwise it will cause problem on big-endian architecture if the number of
bits is not a multiple of BITS_PER_LONG.
I tried testing the logical block provisioning support in scsi_debug,
but it didn't work as I expected.
For example, load scsi_debug module with UNMAP command supported
and fill the storage with random data.
This is unexpected result. Because UNMAP command to LBA 0 finished
without any errors, but Get LBA status shows that LBA 0 is still mapped.
This problem is due to the wrong translation between LBA and index of
provisioning map. Fix it by using correct translation functions.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>