From 373dd8a93aab78d0074188429c350b1e457ddf23 Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Mon, 28 Mar 2011 09:33:37 -0700 Subject: [PATCH] Staging: hv: Get rid of cdb from struct hv_storvsc_request 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 Signed-off-by: Haiyang Zhang Signed-off-by: Abhishek Kane Signed-off-by: Hank Janssen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/blkvsc_drv.c | 3 ++- drivers/staging/hv/storvsc.c | 6 ++---- drivers/staging/hv/storvsc_api.h | 1 - drivers/staging/hv/storvsc_drv.c | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index fb41a5bae480..daa47579f4b7 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -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; diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c index 5a5065c7a56e..ca41c0556a97 100644 --- a/drivers/staging/hv/storvsc.c +++ b/drivers/staging/hv/storvsc.c @@ -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); } @@ -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; diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h index fd3af2b69cda..55c5cc6087e7 100644 --- a/drivers/staging/hv/storvsc_api.h +++ b/drivers/staging/hv/storvsc_api.h @@ -66,7 +66,6 @@ struct storvsc_request_extension { }; struct hv_storvsc_request { - u8 *cdb; u32 status; u32 bytes_xfer; diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index c0ccae25460f..08c2df4d2616 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -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; -- 2.30.2