Staging: hv: Embed struct storvsc_request_extension into hv_storvsc_request
authorK. Y. Srinivasan <kys@microsoft.com>
Mon, 28 Mar 2011 16:33:27 +0000 (09:33 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Apr 2011 04:55:04 +0000 (21:55 -0700)
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>
drivers/staging/hv/blkvsc_drv.c
drivers/staging/hv/storvsc.c
drivers/staging/hv/storvsc_api.h
drivers/staging/hv/storvsc_drv.c

index a5c0ac4bc8949a20205eff0f93856dec89d8f8b8..0a3eb5c00a92046e8a1cecb21c820228e1cf4531 100644 (file)
@@ -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;
 
index 6801e3738766c3a9867f1cacbab61769ee1524a0..5cea33128eda8d53bfe269f5fdaaa50cd3c6e216 100644 (file)
@@ -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);
 
index 800ebbfeb47debaec161c1f5c8057058da401141..e41b68b13110e25a76536422f17b1109bb665b1e 100644 (file)
@@ -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;
 };
index 127d12250dd54b3150bf008ac17951bb7ac14104..58d12e0a88c955aa0d4e521ffe2a4f1a178c5818 100644 (file)
@@ -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);