Skip to content

Commit

Permalink
Staging: hv: Get rid of cdb from struct hv_storvsc_request
Browse files Browse the repository at this point in the history
In preparation for consolidating all I/O request state, get rid of the
cdb field from struct hv_storvsc_request and instead
directly copy the command into struct vmscsi_request.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Apr 5, 2011
1 parent 473f940 commit 373dd8a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion drivers/staging/hv/blkvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,8 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
vm_srb->lun = 0; /* this is not really used at all */

vm_srb->cdb_length = blkvsc_req->cmd_len;
storvsc_req->cdb = blkvsc_req->cmnd;

memcpy(vm_srb->cdb, blkvsc_req->cmnd, vm_srb->cdb_length);

storvsc_req->sense_buffer = blkvsc_req->sense_buffer;
storvsc_req->sense_buffer_size = SCSI_SENSE_BUFFERSIZE;
Expand Down
6 changes: 2 additions & 4 deletions drivers/staging/hv/storvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
if (request->status != 0 || vstor_packet->vm_srb.srb_status != 1) {
DPRINT_WARN(STORVSC,
"cmd 0x%x scsi status 0x%x srb status 0x%x\n",
request->cdb[0], vstor_packet->vm_srb.scsi_status,
vstor_packet->vm_srb.cdb[0],
vstor_packet->vm_srb.scsi_status,
vstor_packet->vm_srb.srb_status);
}

Expand Down Expand Up @@ -551,9 +552,6 @@ int stor_vsc_on_io_request(struct hv_device *device,

vstor_packet->vm_srb.sense_info_length = SENSE_BUFFER_SIZE;

/* Copy over the scsi command descriptor block */
memcpy(&vstor_packet->vm_srb.cdb, request->cdb,
vstor_packet->vm_srb.cdb_length);

vstor_packet->vm_srb.data_transfer_length = request->data_buffer.len;

Expand Down
1 change: 0 additions & 1 deletion drivers/staging/hv/storvsc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ struct storvsc_request_extension {
};

struct hv_storvsc_request {
u8 *cdb;
u32 status;
u32 bytes_xfer;

Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,8 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,

/* ASSERT(scmnd->cmd_len <= 16); */
vm_srb->cdb_length = scmnd->cmd_len;
request->cdb = scmnd->cmnd;

memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length);

request->sense_buffer = scmnd->sense_buffer;
request->sense_buffer_size = SCSI_SENSE_BUFFERSIZE;
Expand Down

0 comments on commit 373dd8a

Please sign in to comment.