mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
Improving thin provisioning support according to recent SBC updates
As the result, Windows 2012 started considered SCST devices thin provisioned Reported and tested by Sergey Tashkinov <sergeyt1@open-e.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5071 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2576,8 +2576,19 @@ static enum compl_status_e vdisk_exec_inquiry(struct vdisk_cmd_params *p)
|
||||
virt_dev->thin_provisioned) {
|
||||
/* Thin Provisioning */
|
||||
buf[1] = 0xB2;
|
||||
buf[3] = 2;
|
||||
buf[5] = 0x80;
|
||||
buf[3] = 4;
|
||||
buf[5] = 0xE0;
|
||||
#if 0 /*
|
||||
* Might be a big performance and functionality win, but might be
|
||||
* dangerous as well, although generally nearly always it should be set,
|
||||
* because nearly all devices should return zero for unmapped blocks.
|
||||
* But let's be on the safe side and disable it for now.
|
||||
*
|
||||
* Changing it change also READ CAPACITY(16)!
|
||||
*/
|
||||
buf[5] |= 0x40; /* LBPRZ */
|
||||
#endif
|
||||
buf[6] = 2; /* thin provisioned */
|
||||
resp_len = buf[3] + 4;
|
||||
} else {
|
||||
TRACE_DBG("INQUIRY: Unsupported EVPD page %x", cmd->cdb[2]);
|
||||
@@ -3342,12 +3353,14 @@ static enum compl_status_e vdisk_exec_read_capacity16(struct vdisk_cmd_params *p
|
||||
|
||||
if (virt_dev->thin_provisioned) {
|
||||
buffer[14] |= 0x80; /* Add LBPME */
|
||||
#if 0 /*
|
||||
* Might be a big performance and functionality win, but might be
|
||||
* dangerous as well, although generally nearly always it should be set,
|
||||
* because nearly all devices should return zero for unmapped blocks.
|
||||
* But let's be on the safe side and disable it for now.
|
||||
*/
|
||||
#if 0 /*
|
||||
* Might be a big performance and functionality win, but might be
|
||||
* dangerous as well, although generally nearly always it should be set,
|
||||
* because nearly all devices should return zero for unmapped blocks.
|
||||
* But let's be on the safe side and disable it for now.
|
||||
*
|
||||
* Changing it change also 0xB2 INQUIRY page!
|
||||
*/
|
||||
buffer[14] |= 0x40; /* Add LBPRZ */
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user