[PATCH 12/20] Staging: hv: Get rid of cdb from struct hv_storvsc_request

From: K. Y. Srinivasan
Date: Mon Mar 28 2011 - 12:24:14 EST


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@xxxxxxxxxxxxx>
Signed-off-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Signed-off-by: Abhishek Kane <v-abkane@xxxxxxxxxxxxx>
Signed-off-by: Hank Janssen <hjanssen@xxxxxxxxxxxxx>
---
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 3db622d..a156930 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -947,7 +947,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 5a5065c..ca41c05 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 fd3af2b..55c5cc6 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 c0ccae2..08c2df4 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;
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/