Commit fa4d123a authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Use the rinbuffer size info in struct storvsc_device_info

Use the rinbuffer size info in struct storvsc_device_info.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 85cf3a98
...@@ -146,6 +146,8 @@ static int blkvsc_device_add(struct hv_device *device, ...@@ -146,6 +146,8 @@ static int blkvsc_device_add(struct hv_device *device,
device_info = (struct storvsc_device_info *)additional_info; device_info = (struct storvsc_device_info *)additional_info;
device_info->ring_buffer_size = blkvsc_ringbuffer_size;
ret = storvsc_dev_add(device, additional_info); ret = storvsc_dev_add(device, additional_info);
if (ret != 0) if (ret != 0)
return ret; return ret;
...@@ -818,14 +820,11 @@ static const struct block_device_operations block_ops = { ...@@ -818,14 +820,11 @@ static const struct block_device_operations block_ops = {
*/ */
static int blkvsc_drv_init(void) static int blkvsc_drv_init(void)
{ {
struct storvsc_driver *storvsc_drv = &blkvsc_drv;
struct hv_driver *drv = &blkvsc_drv.base; struct hv_driver *drv = &blkvsc_drv.base;
int ret; int ret;
BUILD_BUG_ON(sizeof(sector_t) != 8); BUILD_BUG_ON(sizeof(sector_t) != 8);
storvsc_drv->ring_buffer_size = blkvsc_ringbuffer_size;
memcpy(&drv->dev_type, &dev_type, sizeof(struct hv_guid)); memcpy(&drv->dev_type, &dev_type, sizeof(struct hv_guid));
drv->name = drv_name; drv->name = drv_name;
drv->driver.name = drv_name; drv->driver.name = drv_name;
......
...@@ -363,19 +363,17 @@ static void storvsc_on_channel_callback(void *context) ...@@ -363,19 +363,17 @@ static void storvsc_on_channel_callback(void *context)
return; return;
} }
static int storvsc_connect_to_vsp(struct hv_device *device) static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
{ {
struct vmstorage_channel_properties props; struct vmstorage_channel_properties props;
struct storvsc_driver *stor_driver;
int ret; int ret;
stor_driver = drv_to_stordrv(device->device.driver);
memset(&props, 0, sizeof(struct vmstorage_channel_properties)); memset(&props, 0, sizeof(struct vmstorage_channel_properties));
/* Open the channel */ /* Open the channel */
ret = vmbus_open(device->channel, ret = vmbus_open(device->channel,
stor_driver->ring_buffer_size, ring_size,
stor_driver->ring_buffer_size, ring_size,
(void *)&props, (void *)&props,
sizeof(struct vmstorage_channel_properties), sizeof(struct vmstorage_channel_properties),
storvsc_on_channel_callback, device); storvsc_on_channel_callback, device);
...@@ -413,7 +411,7 @@ int storvsc_dev_add(struct hv_device *device, ...@@ -413,7 +411,7 @@ int storvsc_dev_add(struct hv_device *device,
stor_device->port_number = device_info->port_number; stor_device->port_number = device_info->port_number;
/* Send it back up */ /* Send it back up */
ret = storvsc_connect_to_vsp(device); ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
device_info->path_id = stor_device->path_id; device_info->path_id = stor_device->path_id;
device_info->target_id = stor_device->target_id; device_info->target_id = stor_device->target_id;
......
...@@ -733,6 +733,7 @@ static int storvsc_probe(struct hv_device *device) ...@@ -733,6 +733,7 @@ static int storvsc_probe(struct hv_device *device)
} }
device_info.port_number = host->host_no; device_info.port_number = host->host_no;
device_info.ring_buffer_size = storvsc_ringbuffer_size;
/* Call to the vsc driver to add the device */ /* Call to the vsc driver to add the device */
ret = storvsc_dev_add(device, (void *)&device_info); ret = storvsc_dev_add(device, (void *)&device_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment