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>
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 */
#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;
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);
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;
};
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... */
};
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);