Staging: hv: storvsc cleanup/new features
Subsystems (2)
cover Staging: hv: storvsc cleanup/new features
Cleanup storvsc based on review comments from James and implement a couple of new features:
1) The bulk of this patch-set addresses the review comments by James. James, the last time I had posted the patch to move the storage driver out of staging, you wanted to wait until Greg's tree had percolated up. Now, Greg's staging/hv has been merged up. Do you now want me to re-post the patch to move the storage driver out of staging? Let me know.
2) I have also implemented the feature to support hot add/remove of devices configured under the scsi controller on the host.
Regards,
K. Y
PATCH 2/11 Staging: hv: storvsc: Cleanup error handling in the probe function
In reply to K. Y. SrinivasanCleanup error handling in the probe function.
--- drivers/staging/hv/storvsc_drv.c | 42 +++++++++++++++++++++---------------- 1 files changed, 24 insertions(+), 18 deletions(-)
drivers/staging/hv/storvsc_drv.c +24 -18
@@ -1388,17 +1388,14 @@ static int storvsc_probe(struct hv_device *device, host_dev->request_pool);if (!host_dev->request_mempool) { -kmem_cache_destroy (host_dev->request_pool); -scsi_host_put (host); -return -ENOMEM ; + ret = -ENOMEM ; + goto err_out0; } stor_device =kzalloc (sizeof (struct storvsc_device ),GFP_KERNEL );if (!stor_device) { -mempool_destroy (host_dev->request_mempool); -kmem_cache_destroy (host_dev->request_pool); -scsi_host_put (host); -return -ENOMEM ; + ret = -ENOMEM ; + goto err_out1; } stor_device->destroy = false;
@@ -1409,13 +1406,8 @@ static int storvsc_probe(struct hv_device *device, stor_device->port_number = host->host_no; ret =storvsc_connect_to_vsp (device, storvsc_ringbuffer_size); -if (ret) { -mempool_destroy (host_dev->request_mempool); -kmem_cache_destroy (host_dev->request_pool); -scsi_host_put (host); -kfree (stor_device); -return ret; - } +if (ret) + goto err_out2;if (dev_is_ide)storvsc_get_ide_info (device, &target, &path);
@@ -1435,7 +1427,7 @@ static int storvsc_probe(struct hv_device *device,/* Register the HBA and start the scsi bus scan */ ret =scsi_add_host (host, &device->device);if (ret !=0 ) - goto err_out; + goto err_out3;if (!dev_is_ide) {scsi_scan_host (host);
@@ -1444,16 +1436,30 @@ static int storvsc_probe(struct hv_device *device, ret =scsi_add_device (host,0 , target,0 );if (ret) {scsi_remove_host (host); - goto err_out; + goto err_out3; }return 0 ; -err_out: +err_out3: +/* +* Once we have connected with the host, we would need to +* to invoke storvsc_dev_remove() to rollback this state and +* this call also frees up the stor_device; hence the jump around +* err_out2 label. +*/ storvsc_dev_remove (device); + goto err_out1; + +err_out2: +kfree (stor_device); + +err_out1:mempool_destroy (host_dev->request_mempool); + +err_out0:kmem_cache_destroy (host_dev->request_pool);scsi_host_put (host); -return -ENODEV ; +return ret; }/* The one and only one */
Signature · 1 line
1.7.4.1
PATCH 1/11 Staging: hv: storvsc: Use mempools to allocate struct storvsc_cmd_request
In reply to K. Y. SrinivasanWe intend to use the storage driver to manage the root device. To avoid deadlocks, use mempools to allocate struct storvsc_cmd_request.
--- drivers/staging/hv/storvsc_drv.c | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-)
drivers/staging/hv/storvsc_drv.c +25 -5
@@ -32,6 +32,7 @@#include <linux/module.h> #include <linux/device.h> #include <linux/hyperv.h> +#include <linux/mempool.h> #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h> #include <scsi/scsi_host.h>
@@ -42,6 +43,7 @@#include <scsi/scsi_dbg.h> +#define STORVSC_MIN_BUF_NR 64#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)static int storvsc_ringbuffer_size =STORVSC_RING_BUFFER_SIZE ;
@@ -287,6 +289,7 @@ struct storvsc_device {struct hv_host_device {struct hv_device *dev;struct kmem_cache *request_pool; +mempool_t *request_mempool;unsigned int port;unsigned char path;unsigned char target;
@@ -974,8 +977,10 @@ static int storvsc_remove(struct hv_device *dev)storvsc_dev_remove (dev);if (host_dev->request_pool) { +mempool_destroy (host_dev->request_mempool);kmem_cache_destroy (host_dev->request_pool); host_dev->request_pool =NULL ; + host_dev->request_mempool =NULL ; }return 0 ; }
@@ -1120,7 +1125,7 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)scsi_done_fn (scmnd); -kmem_cache_free (host_dev->request_pool, cmd_request); +mempool_free (cmd_request, host_dev->request_mempool); }static bool storvsc_check_scsi_cmd (struct scsi_cmnd *scmnd)
@@ -1176,12 +1181,13 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, request_size =sizeof (struct storvsc_cmd_request ); - cmd_request =kmem_cache_zalloc (host_dev->request_pool, + cmd_request =mempool_alloc (host_dev->request_mempool,GFP_ATOMIC );if (!cmd_request) { scmnd->scsi_done =NULL ;return SCSI_MLQUEUE_DEVICE_BUSY ; } +memset (cmd_request,0 ,sizeof (struct storvsc_cmd_request ));/* Setup the cmd request */ cmd_request->bounce_sgl_count =0 ;
@@ -1235,8 +1241,8 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,if (!cmd_request->bounce_sgl) { scmnd->scsi_done =NULL ; scmnd->host_scribble =NULL ; -kmem_cache_free (host_dev->request_pool, - cmd_request); +mempool_free (cmd_request, + host_dev->request_mempool);return SCSI_MLQUEUE_HOST_BUSY ; }
@@ -1278,7 +1284,7 @@ retry_request:destroy_bounce_buffer (cmd_request->bounce_sgl, cmd_request->bounce_sgl_count); -kmem_cache_free (host_dev->request_pool, cmd_request); +mempool_free (cmd_request, host_dev->request_mempool); scmnd->scsi_done =NULL ; scmnd->host_scribble =NULL ;
@@ -1348,6 +1354,7 @@ static int storvsc_probe(struct hv_device *device, const struct hv_vmbus_device_id *dev_id) {int ret; +int number =STORVSC_MIN_BUF_NR ;struct Scsi_Host *host;struct hv_host_device *host_dev;bool dev_is_ide = ((dev_id->driver_data ==IDE_GUID ) ? true : false);
@@ -1376,8 +1383,19 @@ static int storvsc_probe(struct hv_device *device,return -ENOMEM ; } + host_dev->request_mempool =mempool_create (number, mempool_alloc_slab, + mempool_free_slab, + host_dev->request_pool); + +if (!host_dev->request_mempool) { +kmem_cache_destroy (host_dev->request_pool); +scsi_host_put (host); +return -ENOMEM ; + } + stor_device =kzalloc (sizeof (struct storvsc_device ),GFP_KERNEL );if (!stor_device) { +mempool_destroy (host_dev->request_mempool);kmem_cache_destroy (host_dev->request_pool);scsi_host_put (host);return -ENOMEM ;
@@ -1392,6 +1410,7 @@ static int storvsc_probe(struct hv_device *device, stor_device->port_number = host->host_no; ret =storvsc_connect_to_vsp (device, storvsc_ringbuffer_size);if (ret) { +mempool_destroy (host_dev->request_mempool);kmem_cache_destroy (host_dev->request_pool);scsi_host_put (host);kfree (stor_device);
@@ -1431,6 +1450,7 @@ static int storvsc_probe(struct hv_device *device, err_out:storvsc_dev_remove (device); +mempool_destroy (host_dev->request_mempool);kmem_cache_destroy (host_dev->request_pool);scsi_host_put (host);return -ENODEV ;
Signature · 1 line
1.7.4.1
PATCH 7/11 Staging: hv: storvsc: use the macro KBUILD_MODNAME
Use the macro KBUILD_MODNAME.
--- drivers/staging/hv/storvsc_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/hv/storvsc_drv.c +1 -1
@@ -1444,7 +1444,7 @@ err_out0:/* The one and only one */ static struct hv_driver storvsc_drv = { - .name ="storvsc" , + .name =KBUILD_MODNAME , .id_table = id_table, .probe = storvsc_probe, .remove = storvsc_remove,
Signature · 1 line
1.7.4.1
PATCH 6/11 Staging: hv: storvsc: Use the unlocked version queuecommand
In reply to K. Y. SrinivasanUse the unlocked version queuecommand.
--- drivers/staging/hv/storvsc_drv.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-)
drivers/staging/hv/storvsc_drv.c +5 -14
@@ -1137,11 +1137,10 @@ static bool storvsc_check_scsi_cmd(struct scsi_cmnd *scmnd)/* * storvsc_queuecommand - Initiate command processing */ -static int storvsc_queuecommand_lck (struct scsi_cmnd *scmnd, -void (*done)(struct scsi_cmnd *)) +static int storvsc_queuecommand (struct Scsi_Host *host,struct scsi_cmnd *scmnd) {int ret; -struct hv_host_device *host_dev =shost_priv (scmnd->device->host); +struct hv_host_device *host_dev =shost_priv (host);struct hv_device *dev = host_dev->dev;struct hv_storvsc_request *request;struct storvsc_cmd_request *cmd_request;
@@ -1152,7 +1151,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,struct vmscsi_request *vm_srb;if (storvsc_check_scsi_cmd (scmnd) == false) { -done (scmnd); + scmnd->scsi_done (scmnd);return 0 ; }
@@ -1165,16 +1164,13 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, goto retry_request; } - scmnd->scsi_done = done; - request_size =sizeof (struct storvsc_cmd_request ); cmd_request =mempool_alloc (host_dev->request_mempool,GFP_ATOMIC ); -if (!cmd_request) { - scmnd->scsi_done =NULL ; +if (!cmd_request)return SCSI_MLQUEUE_DEVICE_BUSY ; - } +memset (cmd_request,0 ,sizeof (struct storvsc_cmd_request ));/* Setup the cmd request */
@@ -1227,7 +1223,6 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,create_bounce_buffer (sgl,scsi_sg_count (scmnd),scsi_bufflen (scmnd));if (!cmd_request->bounce_sgl) { - scmnd->scsi_done =NULL ; scmnd->host_scribble =NULL ;mempool_free (cmd_request, host_dev->request_mempool);
@@ -1274,7 +1269,6 @@ retry_request:mempool_free (cmd_request, host_dev->request_mempool); - scmnd->scsi_done =NULL ; scmnd->host_scribble =NULL ; ret =SCSI_MLQUEUE_DEVICE_BUSY ;
@@ -1283,9 +1277,6 @@ retry_request:return ret; } -static DEF_SCSI_QCMD (storvsc_queuecommand) - -/* Scsi driver */ static struct scsi_host_template scsi_driver = { .module =THIS_MODULE ,
Signature · 1 line
1.7.4.1
PATCH 8/11 Staging: hv: storvsc: Get rid of an unnecessary forward declaration
In reply to K. Y. SrinivasanGet rid of an unnecessary forward declaration.
--- drivers/staging/hv/storvsc_drv.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/staging/hv/storvsc_drv.c +0 -2
@@ -236,8 +236,6 @@ struct vstor_packet {#define STORVSC_MAX_CHANNELS 1#define STORVSC_MAX_CMD_LEN 16 -struct hv_storvsc_request ; -/* Matches Windows-end */ enum storvsc_request_type {WRITE_TYPE ,
Signature · 1 line
1.7.4.1
PATCH 3/11 Staging: hv: storvsc: Fixup the error when processing SET_WINDOW command
In reply to K. Y. SrinivasanFixup the error when processing SET_WINDOW command.
--- drivers/staging/hv/storvsc_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/hv/storvsc_drv.c +1 -1
@@ -1136,7 +1136,7 @@ static bool storvsc_check_scsi_cmd(struct scsi_cmnd *scmnd)switch (scsi_op) {/* smartd sends this command, which will offline the device */ case SET_WINDOW : - scmnd->result =DID_ERROR <<16 ; + scmnd->result =ILLEGAL_REQUEST <<16 ; allowed = false;break ;default :
Signature · 1 line
1.7.4.1
PATCH 4/11 Staging: hv: storvsc: Fix error handling storvsc_host_reset()
In reply to K. Y. SrinivasanFix error handling storvsc_host_reset(). I would like to thank Long Li <[email protected]> for reporting this.
--- drivers/staging/hv/storvsc_drv.c | 20 ++++++-------------- 1 files changed, 6 insertions(+), 14 deletions(-)
drivers/staging/hv/storvsc_drv.c +6 -14
@@ -1019,7 +1019,7 @@ static int storvsc_host_reset(struct hv_device *device) stor_device =get_out_stor_device (device);if (!stor_device) -return -ENODEV ; +return FAILED ; request = &stor_device->reset_request; vstor_packet = &request->vstor_packet;
@@ -1036,13 +1036,11 @@ static int storvsc_host_reset(struct hv_device *device)VM_PKT_DATA_INBAND , VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);if (ret !=0 ) - goto cleanup; +return FAILED ; t =wait_for_completion_timeout (&request->wait_event,5 *HZ ); -if (t ==0 ) { - ret = -ETIMEDOUT ; - goto cleanup; - } +if (t ==0 ) +return TIMEOUT_ERROR ;/*
@@ -1050,8 +1048,7 @@ static int storvsc_host_reset(struct hv_device *device)* should have been flushed out and return to us */ -cleanup: -return ret; +return SUCCESS ; }
@@ -1060,16 +1057,11 @@ cleanup:*/ static int storvsc_host_reset_handler (struct scsi_cmnd *scmnd) { -int ret;struct hv_host_device *host_dev = (struct hv_host_device *)scmnd->device->host->hostdata;struct hv_device *dev = host_dev->dev; - ret =storvsc_host_reset (dev); -if (ret !=0 ) -return ret; - -return ret; +return storvsc_host_reset (dev); }
Signature · 1 line
1.7.4.1
PATCH 5/11 Staging: hv: storvsc: Use the accessor function shost_priv()
In reply to K. Y. SrinivasanUse the accessor function shost_priv().
--- drivers/staging/hv/storvsc_drv.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-)
drivers/staging/hv/storvsc_drv.c +5 -9
@@ -968,8 +968,7 @@ static int storvsc_remove(struct hv_device *dev) {struct storvsc_device *stor_device =hv_get_drvdata (dev);struct Scsi_Host *host = stor_device->host; -struct hv_host_device *host_dev = - (struct hv_host_device *)host->hostdata; +struct hv_host_device *host_dev =shost_priv (host);scsi_remove_host (host);
@@ -1057,8 +1056,7 @@ static int storvsc_host_reset(struct hv_device *device)*/ static int storvsc_host_reset_handler (struct scsi_cmnd *scmnd) { -struct hv_host_device *host_dev = - (struct hv_host_device *)scmnd->device->host->hostdata; +struct hv_host_device *host_dev =shost_priv (scmnd->device->host);struct hv_device *dev = host_dev->dev;return storvsc_host_reset (dev);
@@ -1073,8 +1071,7 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)struct storvsc_cmd_request *cmd_request = (struct storvsc_cmd_request *)request->context;struct scsi_cmnd *scmnd = cmd_request->cmd; -struct hv_host_device *host_dev = - (struct hv_host_device *)scmnd->device->host->hostdata; +struct hv_host_device *host_dev =shost_priv (scmnd->device->host);void (*scsi_done_fn)(struct scsi_cmnd *);struct scsi_sense_hdr sense_hdr;struct vmscsi_request *vm_srb;
@@ -1144,8 +1141,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, void (*done)(struct scsi_cmnd *)) {int ret; -struct hv_host_device *host_dev = - (struct hv_host_device *)scmnd->device->host->hostdata; +struct hv_host_device *host_dev =shost_priv (scmnd->device->host);struct hv_device *dev = host_dev->dev;struct hv_storvsc_request *request;struct storvsc_cmd_request *cmd_request;
@@ -1359,7 +1355,7 @@ static int storvsc_probe(struct hv_device *device,if (!host)return -ENOMEM ; - host_dev = (struct hv_host_device *)host->hostdata; + host_dev =shost_priv (host);memset (host_dev,0 ,sizeof (struct hv_host_device )); host_dev->port = host->host_no;
Signature · 1 line
1.7.4.1
PATCH 11/11 Staging: hv: storvsc: Support hot-removing of scsi devices
In reply to K. Y. SrinivasanSupport hot-removing of scsi devices.
--- drivers/staging/hv/storvsc_drv.c | 45 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-)
drivers/staging/hv/storvsc_drv.c +45 -0
@@ -328,6 +328,27 @@ static void storvsc_bus_scan(struct work_struct *work)kfree (wrk); } +static void storvsc_remove_lun (struct work_struct *work) +{ +struct storvsc_scan_work *wrk; +struct scsi_device *sdev; + + wrk = container_of(work, struct storvsc_scan_work, work); +if (!scsi_host_get (wrk->host)) + goto done; + + sdev =scsi_device_lookup (wrk->host,0 ,0 , wrk->lun); + +if (sdev) { +scsi_remove_device (sdev); +scsi_device_put (sdev); + } +scsi_host_put (wrk->host); + +done: +kfree (wrk); +} +static inline struct storvsc_device *get_out_stor_device (struct hv_device *device) {
@@ -1112,6 +1133,7 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)void (*scsi_done_fn)(struct scsi_cmnd *);struct scsi_sense_hdr sense_hdr;struct vmscsi_request *vm_srb; +struct storvsc_scan_work *wrk; vm_srb = &request->vstor_packet.vm_srb;if (cmd_request->bounce_sgl_count) {
@@ -1134,6 +1156,29 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)else scmnd->result = vm_srb->scsi_status; +/* +* If the LUN is invalid; remove the device. +*/ +if (vm_srb->srb_status ==0x20 ) { +struct storvsc_device *stor_dev; +struct hv_device *dev = host_dev->dev; +struct Scsi_Host *host; + + stor_dev =get_in_stor_device (dev); + host = stor_dev->host; + + wrk =kmalloc (sizeof (struct storvsc_scan_work ), +GFP_ATOMIC ); +if (!wrk) { + scmnd->result =DID_TARGET_FAILURE <<16 ; + }else { + wrk->host = host; + wrk->lun = vm_srb->lun; +INIT_WORK (&wrk->work, storvsc_remove_lun); +schedule_work (&wrk->work); + } + } +if (scmnd->result) {if (scsi_normalize_sense (scmnd->sense_buffer,SCSI_SENSE_BUFFERSIZE , &sense_hdr))
Signature · 1 line
1.7.4.1
PATCH 9/11 Staging: hv: storvsc: Upgrade the vmstor protocol version
In reply to K. Y. SrinivasanIn preparation for supporting hot add/remove of scsi devices, upgrade the vmstor protocol version.
--- drivers/staging/hv/storvsc_drv.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/staging/hv/storvsc_drv.c +3 -2
@@ -80,7 +80,7 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");/* V1 Beta 0.1 */ /* V1 RC < 2008/1/31 1.0 */ /* V1 RC > 2008/1/31 2.0 */ -#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(2, 0) +#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(4, 2)
@@ -106,7 +106,8 @@ enum vstor_packet_operation {VSTOR_OPERATION_END_INITIALIZATION =8 ,VSTOR_OPERATION_QUERY_PROTOCOL_VERSION =9 ,VSTOR_OPERATION_QUERY_PROPERTIES =10 , - VSTOR_OPERATION_MAXIMUM = 10 +VSTOR_OPERATION_ENUMERATE_BUS =11 , + VSTOR_OPERATION_MAXIMUM = 11 };/*
Signature · 1 line
1.7.4.1
Quoted 10 lines · K. Y. Srinivasan
Cleanup storvsc based on review comments from James and implement a couple of new features:
1) The bulk of this patch-set addresses the review comments by James. James, the last time I had posted the patch to move the storage driver out of staging, you wanted to wait until Greg's tree had percolated up. Now, Greg's staging/hv has been merged up. Do you now want me to re-post the patch to move the storage driver out of staging? Let me know.
Quoted 2 lines
2) I have also implemented the feature to support hot add/remove of devices configured under the scsi controller on the host.
If you want scsi review on this, it should go to the scsi list:
James
Quoted 22 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Tuesday, November 08, 2011 11:40 AM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 0000/0011] Staging: hv: storvsc cleanup/new featuresQuoted 10 lines · K. Y. Srinivasan
Cleanup storvsc based on review comments from James and implement a couple of new features:
1) The bulk of this patch-set addresses the review comments by James. James, the last time I had posted the patch to move the storage driver out of staging, you wanted to wait until Greg's tree had percolated up. Now, Greg's staging/hv has been merged up. Do you now want me to re-post the patch to move the storage driver out of staging? Let me know.
Quoted 6 lines
Quoted 2 lines
2) I have also implemented the feature to support hot add/remove of devices configured under the scsi controller on the host.
If you want scsi review on this, it should go to the scsi list:
These patches are against Greg's current staging tree.
I was planning to send the patch that would move this driver out of staging (that would include the cleanup patches I just sent out) to the scsi list. I am going to send it out shortly.
Regards,
K. Y
PATCH 10/11 Staging: hv: storvsc: Support hot add of scsi disks
In reply to K. Y. SrinivasanSupport hot add of scsi disks.
--- drivers/staging/hv/storvsc_drv.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-)
drivers/staging/hv/storvsc_drv.c +38 -0
@@ -304,6 +304,30 @@ struct storvsc_cmd_request {struct hv_storvsc_request request; }; +struct storvsc_scan_work { +struct work_struct work; +struct Scsi_Host *host; +uint lun; +}; + +static void storvsc_bus_scan (struct work_struct *work) +{ +struct storvsc_scan_work *wrk; +int id, order_id; + + wrk = container_of(work, struct storvsc_scan_work, work); +for (id =0 ; id < wrk->host->max_id; ++id) { +if (wrk->host->reverse_ordering) + order_id = wrk->host->max_id - id -1 ; +else + order_id = id; + +scsi_scan_target (&wrk->host->shost_gendev,0 , + order_id,SCAN_WILD_CARD ,1 ); + } +kfree (wrk); +} +static inline struct storvsc_device *get_out_stor_device (struct hv_device *device) {
@@ -551,11 +575,25 @@ static void storvsc_on_receive(struct hv_device *device,struct vstor_packet *vstor_packet, struct hv_storvsc_request *request) { + struct storvsc_scan_work *work; +struct storvsc_device *stor_device; +switch (vstor_packet->operation) {case VSTOR_OPERATION_COMPLETE_IO :storvsc_on_io_completion (device, vstor_packet, request);break ; +case VSTOR_OPERATION_REMOVE_DEVICE : +case VSTOR_OPERATION_ENUMERATE_BUS : + stor_device =get_in_stor_device (device); + work =kmalloc (sizeof (struct storvsc_scan_work ),GFP_ATOMIC ); +if (!work) +return ; + +INIT_WORK (&work->work, storvsc_bus_scan); + work->host = stor_device->host; +schedule_work (&work->work); +break ;default :break ;
Signature · 1 line
1.7.4.1