scsi: storvsc: Retrieve information about the capability of the target
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 27 Mar 2015 07:27:17 +0000 (00:27 -0700)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 9 Apr 2015 20:22:11 +0000 (13:22 -0700)
The storage protocol informs the guest of the I/O capabilities of the storage
stack. Retrieve this information and use it in the guest.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/storvsc_drv.c

index 0ba7f2cbbbc3e6c2616e32b5542cb200d8662f99..cdf048ba4d2d60e879c9e6d70053dafbffd1c809 100644 (file)
@@ -377,6 +377,10 @@ struct storvsc_device {
        unsigned char path_id;
        unsigned char target_id;
 
+       /*
+        * Max I/O, the device can support.
+        */
+       u32   max_transfer_bytes;
        /* Used for vsc/vsp channel reset process */
        struct storvsc_cmd_request init_request;
        struct storvsc_cmd_request reset_request;
@@ -974,6 +978,8 @@ static int storvsc_channel_init(struct hv_device *device)
                    STORAGE_CHANNEL_SUPPORTS_MULTI_CHANNEL)
                        process_sub_channels = true;
        }
+       stor_device->max_transfer_bytes =
+               vstor_packet->storage_channel_properties.max_transfer_bytes;
 
        memset(vstor_packet, 0, sizeof(struct vstor_packet));
        vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION;