Re: [PATCH] virtio: Decrement avail idx on buffer detach

2011-03-28 Thread Amit Shah
On (Thu) 17 Mar 2011 [17:56:59], Amit Shah wrote: On (Thu) 17 Mar 2011 [15:26:28], Rusty Russell wrote: On Wed, 16 Mar 2011 19:12:10 +0530, Amit Shah amit.s...@redhat.com wrote: When detaching a buffer from a vq, the avail.idx value should be decremented as well. This was noticed

[PATCH 00/20] Staging: hv: Cleanup-storage-drivers-phase-II

2011-03-28 Thread K. Y. Srinivasan
This patch-set restructures and cleans up struct hv_storvsc_request. In the current code, two data structures: struct hv_storvsc_request and struct storvsc_request_extension together are used to carry the I/O state and there are many issues with this current architecture: 1) The memory

[PATCH 11/20] Staging: hv: Get rid of the cdb_len from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation for consolidating all I/O request state, get rid of the cdb_len field from struct hv_storvsc_request and instead use the equivalent state in struct vmscsi_request - cdb_length field. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang

[PATCH 07/20] Staging: hv: Get rid of the host field from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation for consolidating all I/O request state, get rid of the host field from struct hv_storvsc_request and instead use the equivalent state in struct vmscsi_request - port_number field. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang

[PATCH 10/20] Staging: hv: Get rid of lun_id from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation for consolidating all I/O request state, get rid of the lun_id field from struct hv_storvsc_request and instead use the equivalent state in struct vmscsi_request - lun field. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com

[PATCH 12/20] Staging: hv: Get rid of cdb from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation for consolidating all I/O request state, get rid of the cdb field from struct hv_storvsc_request and instead directly copy the command into struct vmscsi_request. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by:

[PATCH 20/20] Staging: hv: Get rid of synch primitive in struct blkvsc_request

2011-03-28 Thread K. Y. Srinivasan
Get rid of synch primitive in struct blkvsc_request and instead use the synch primitive already embedded in the struct hv_storvsc_request structure. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane

[PATCH 17/20] Staging: hv: Get rid of the status field from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation of consolidating all I/O request state, get rid of the status field from struct hv_storvsc_request and instead use the state in the struct vmscsi_request directly. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by:

[PATCH 06/20] Staging: hv: Get rid of the type field from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation for consolidating all I/O request state, get rid of the type field from struct hv_storvsc_request and instead use the equivalent state in struct vmscsi_request - data_in field. In the current code there is a call to zero out the struct vstor_packet in stor_vsc_on_io_request(). So,

[PATCH 01/20] Staging: hv: Move the definition of struct storvsc_request_extension

2011-03-28 Thread K. Y. Srinivasan
In preperation for embedding struct storvsc_request_extension into struct hv_storvsc_request, move the definition of struct storvsc_request_extension. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane

[PATCH 16/20] Staging: hv: Move on_io_completion() from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation of consolidating all I/O request state, move the on_io_completion() field from struct hv_storvsc_request to struct storvsc_request_extension. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane

[PATCH 15/20] Staging: hv: Move the context field from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation of consolidating all I/O request state, move the context field from struct hv_storvsc_request to struct storvsc_request_extension. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane

[PATCH 02/20] Staging: hv: Embed struct storvsc_request_extension into hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
Embed struct storvsc_request_extension into hv_storvsc_request. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 05/20] Staging: hv: Use struct completion in struct storvsc_request_extension

2011-03-28 Thread K. Y. Srinivasan
Get rid of the wait_queue mechanism for synchronization in struct storvsc_request_extension and instead use completion mechanism. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com

[PATCH 18/20] Staging: hv: Move the data_buffer field from struct hv_storvsc_request

2011-03-28 Thread K. Y. Srinivasan
In preparation of consolidating all I/O request state, move the data_buffer field from struct hv_storvsc_request struct storvsc_request_extension. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane

[PATCH 03/20] Staging: hv: Get rid of request_ext_size from struct storvsc_driver_object

2011-03-28 Thread K. Y. Srinivasan
Now that struct storvsc_request_extension is part of struct hv_storvsc_request get rid of the field request_ext_size from struct storvsc_driver_object. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane

[PATCH 19/20] Staging: hv: Rename struct storvsc_request_extension

2011-03-28 Thread K. Y. Srinivasan
Now that all duplicate state has been eliminated from struct hv_storvsc_request and all needed state has been moved to struct storvsc_request_extension, get rid of struct hv_storvsc_request and rename struct storvsc_request_extension as struct hv_storvsc_request. Cleanup and consolidation of I/O

[PATCH 03/22] Staging: hv: Get rid of the forward declaration of blkvsc_open()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_open() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 09/22] Staging: hv: Get rid of the forward declaration of blkvsc_cancel_pending_reqs()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_cancel_pending_reqs() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen

[PATCH 15/22] Staging: hv: Get rid of the forward declaration of blkvsc_revalidate_disk()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_revalidate_disk() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com

[PATCH 20/22] Staging: hv: Move some definitions/declarations to be earlier in the file

2011-03-28 Thread K. Y. Srinivasan
Move some definitions/declarations to be earlier in the file. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 06/22] Staging: hv: Get rid of the forward declaration of blkvsc_ioctl()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_ioctl() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 18/22] Staging: hv: Get rid of the forward declaration for blkvsc_do_pending_reqs()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration for blkvsc_do_pending_reqs() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com

[PATCH 10/22] Staging: hv: Get rid of the forward declaration of blkvsc_remove()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_remove() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 17/22] Staging: hv: Get rid of the forward declaration for blkvsc_do_request()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration for blkvsc_do_request() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 01/22] Staging: hv: Get rid of the forward declaration of blkvsc_submit_request()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_submit_request() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com

[PATCH 19/22] Staging: hv: Get rid of the forward declaration for blkvsc_request()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration for blkvsc_request() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 08/22] Staging: hv: Get rid of the forward declaration of blkvsc_do_flush()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_do_flush() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 22/22] Staging: hv: Get rid of some dead code in blkvsc_drv.c

2011-03-28 Thread K. Y. Srinivasan
Get rid of some dead code in blkvsc_drv.c. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/blkvsc_drv.c | 26

[PATCH 02/22] Staging: hv: Get rid of the forward declaration of blkvsc_media_changed()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_media_changed() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 05/22] Staging: hv: Get rid of the forward declaration of blkvsc_init_rw()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_init_rw() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 12/22] Staging: hv: Get rid of the forward declaration for blkvsc_release()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration for blkvsc_release() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 07/22] Staging: hv: Get rid of the forward declaration of blkvsc_cmd_completion()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_cmd_completion() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com

[PATCH 16/22] Staging: hv: Get rid of the forward declaration for blkvsc_do_inquiry()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration for blkvsc_do_inquiry() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 00/22] Staging: hv: Cleanup-storage-drivers-phase-III

2011-03-28 Thread K. Y. Srinivasan
This patch-set deals with some of the style isues in blkvsc_drv.c. We also get rid most of the dead code in this file: 1) Get rid of most of the forward declarations in this file. The only remaining forward declarations are to deal with circular dependencies.

[PATCH 13/22] Staging: hv: Get rid of the forward declaration for blkvsc_do_read_capacity()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration for blkvsc_do_read_capacity() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com

[PATCH 21/22] Staging: hv: Move module parameter to earlier in the file

2011-03-28 Thread K. Y. Srinivasan
Move module parameter to be earlier in the file. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com --- drivers/staging/hv/blkvsc_drv.c |

[PATCH 04/22] Staging: hv: Get rid of the forward declaration of blkvsc_getgeo()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_getgeo() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen hjans...@microsoft.com ---

[PATCH 14/22] Staging: hv: Get rid of the forward declaration of blkvsc_do_read_capacity16()

2011-03-28 Thread K. Y. Srinivasan
Get rid of the forward declaration of blkvsc_do_read_capacity16() by moving the code around. Signed-off-by: K. Y. Srinivasan k...@microsoft.com Signed-off-by: Haiyang Zhang haiya...@microsoft.com Signed-off-by: Abhishek Kane v-abk...@microsoft.com Signed-off-by: Hank Janssen