Commit 2fd0df27 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Embed struct storvsc_request_extension into hv_storvsc_request

Embed struct storvsc_request_extension into hv_storvsc_request.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bf587a1d
......@@ -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;
......
......@@ -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);
......
......@@ -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;
};
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment