Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281032
b: refs/heads/master
c: bab445e
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent 1b6c852 commit 1445546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f33f30a67cebbdaa938e34c5144424d2f0ce9cc
refs/heads/master: bab445e12b45153282fb7d39143516e11987deaa
19 changes: 5 additions & 14 deletions trunk/drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1274,7 +1269,6 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,

mempool_free(cmd_request, host_dev->request_mempool);

scmnd->scsi_done = NULL;
scmnd->host_scribble = NULL;

ret = SCSI_MLQUEUE_DEVICE_BUSY;
Expand All @@ -1283,9 +1277,6 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
return ret;
}

static DEF_SCSI_QCMD(storvsc_queuecommand)


/* Scsi driver */
static struct scsi_host_template scsi_driver = {
.module = THIS_MODULE,
Expand Down

0 comments on commit 1445546

Please sign in to comment.