From 2fd0df276e4ebb411dd0f87a2c9381b466f81ed4 Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Mon, 28 Mar 2011 09:33:27 -0700 Subject: [PATCH] Staging: hv: Embed struct storvsc_request_extension into hv_storvsc_request Embed struct storvsc_request_extension into hv_storvsc_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 | 8 -------- drivers/staging/hv/storvsc.c | 3 +-- drivers/staging/hv/storvsc_api.h | 3 +-- drivers/staging/hv/storvsc_drv.c | 6 ------ 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index a5c0ac4bc894..0a3eb5c00a92 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -84,12 +84,6 @@ struct blkvsc_request { unsigned char cmnd[MAX_COMMAND_SIZE]; struct hv_storvsc_request request; - /* - * !!!DO NOT ADD ANYTHING BELOW HERE!!! Otherwise, memory can overlap, - * because - The extension buffer falls right here and is pointed to by - * request.Extension; - * Which sounds like a horrible idea, who designed this? - */ }; /* Per device structure */ @@ -944,8 +938,6 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, #endif storvsc_req = &blkvsc_req->request; - storvsc_req->extension = (void *)((unsigned long)blkvsc_req + - sizeof(struct blkvsc_request)); storvsc_req->type = blkvsc_req->write ? WRITE_TYPE : READ_TYPE; diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c index 6801e3738766..5cea33128eda 100644 --- a/drivers/staging/hv/storvsc.c +++ b/drivers/staging/hv/storvsc.c @@ -533,8 +533,7 @@ int stor_vsc_on_io_request(struct hv_device *device, struct vstor_packet *vstor_packet; int ret = 0; - request_extension = - (struct storvsc_request_extension *)request->extension; + request_extension = &request->extension; vstor_packet = &request_extension->vstor_packet; stor_device = get_stor_device(device); diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h index 800ebbfeb47d..e41b68b13110 100644 --- a/drivers/staging/hv/storvsc_api.h +++ b/drivers/staging/hv/storvsc_api.h @@ -83,8 +83,7 @@ struct hv_storvsc_request { void (*on_io_completion)(struct hv_storvsc_request *request); - /* This points to the memory after DataBuffer */ - void *extension; + struct storvsc_request_extension extension; struct hv_multipage_buffer data_buffer; }; diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index 127d12250dd5..58d12e0a88c9 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -69,10 +69,6 @@ struct storvsc_cmd_request { struct scatterlist *bounce_sgl; struct hv_storvsc_request request; - /* !!!DO NOT ADD ANYTHING BELOW HERE!!! */ - /* The extension buffer falls right here and is pointed to by - * request.Extension; - * Which sounds like a very bad design... */ }; @@ -763,8 +759,6 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, request = &cmd_request->request; - request->extension = - (void *)((unsigned long)cmd_request + request_size); DPRINT_DBG(STORVSC_DRV, "req %p size %d ext %d", request, request_size, storvsc_drv_obj->request_ext_size); -- 2.30.2