Skip to content

Commit

Permalink
Staging: hv: Embed struct storvsc_request_extension into hv_storvsc_r…
Browse files Browse the repository at this point in the history
…equest

Embed struct storvsc_request_extension into hv_storvsc_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 bf587a1 commit 2fd0df2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
8 changes: 0 additions & 8 deletions drivers/staging/hv/blkvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/hv/storvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/hv/storvsc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
6 changes: 0 additions & 6 deletions drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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... */
};


Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 2fd0df2

Please sign in to comment.