K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[RESEND] [PATCH 00/18] Staging: hv: Cleanup-storage-drivers-phase-III
This is a resend of a previously sent patch-set. 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. 2) Get rid of most of the dead code in the file. Some of the functions in this file are place holders - they are not fuly implementedi yet (blkvsc_ioctl(), blkvsc_media_changed(). We have retained some comments/dead code, to help us in the final implementation. Regads, K. Y
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 01/18] Staging: hv: Get rid of the forward declaration of blkvsc_init_rw()
Get rid of the forward declaration of blkvsc_init_rw() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 117 ++++++++++++++++++++------------------- 1 files changed, 59 insertions(+), 58 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index c0d38a8..f4f6545 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -348,6 +348,65 @@ static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg) return 0; } + +static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) +{ + /* ASSERT(blkvsc_req->req); */ + /* ASSERT(blkvsc_req->sector_count <+ (MAX_MULTIPAGE_BUFFER_COUNT*8)); */ + + blkvsc_req->cmd_len = 16; + + if (blkvsc_req->sector_start > 0xffffffff) { + if (rq_data_dir(blkvsc_req->req)) { + blkvsc_req->write = 1; + blkvsc_req->cmnd[0] = WRITE_16; + } else { + blkvsc_req->write = 0; + blkvsc_req->cmnd[0] = READ_16; + } + + blkvsc_req->cmnd[1] |+ (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0; + + *(unsigned long long *)&blkvsc_req->cmnd[2] + cpu_to_be64(blkvsc_req->sector_start); + *(unsigned int *)&blkvsc_req->cmnd[10] + cpu_to_be32(blkvsc_req->sector_count); + } else if ((blkvsc_req->sector_count > 0xff) || + (blkvsc_req->sector_start > 0x1fffff)) { + if (rq_data_dir(blkvsc_req->req)) { + blkvsc_req->write = 1; + blkvsc_req->cmnd[0] = WRITE_10; + } else { + blkvsc_req->write = 0; + blkvsc_req->cmnd[0] = READ_10; + } + + blkvsc_req->cmnd[1] |+ (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0; + + *(unsigned int *)&blkvsc_req->cmnd[2] + cpu_to_be32(blkvsc_req->sector_start); + *(unsigned short *)&blkvsc_req->cmnd[7] + cpu_to_be16(blkvsc_req->sector_count); + } else { + if (rq_data_dir(blkvsc_req->req)) { + blkvsc_req->write = 1; + blkvsc_req->cmnd[0] = WRITE_6; + } else { + blkvsc_req->write = 0; + blkvsc_req->cmnd[0] = READ_6; + } + + *(unsigned int *)&blkvsc_req->cmnd[1] + cpu_to_be32(blkvsc_req->sector_start) >> 8; + blkvsc_req->cmnd[1] &= 0x1f; + blkvsc_req->cmnd[4] = (unsigned char)blkvsc_req->sector_count; + } +} + + /* Static decl */ static int blkvsc_probe(struct device *dev); static int blkvsc_remove(struct device *device); @@ -361,7 +420,6 @@ static void blkvsc_request(struct request_queue *queue); static void blkvsc_request_completion(struct hv_storvsc_request *request); static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req); -static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req); static void blkvsc_cmd_completion(struct hv_storvsc_request *request); static int blkvsc_do_inquiry(struct block_device_context *blkdev); static int blkvsc_do_read_capacity(struct block_device_context *blkdev); @@ -991,63 +1049,6 @@ static int blkvsc_remove(struct device *device) return ret; } -static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) -{ - /* ASSERT(blkvsc_req->req); */ - /* ASSERT(blkvsc_req->sector_count <= (MAX_MULTIPAGE_BUFFER_COUNT*8)); */ - - blkvsc_req->cmd_len = 16; - - if (blkvsc_req->sector_start > 0xffffffff) { - if (rq_data_dir(blkvsc_req->req)) { - blkvsc_req->write = 1; - blkvsc_req->cmnd[0] = WRITE_16; - } else { - blkvsc_req->write = 0; - blkvsc_req->cmnd[0] = READ_16; - } - - blkvsc_req->cmnd[1] |- (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0; - - *(unsigned long long *)&blkvsc_req->cmnd[2] - cpu_to_be64(blkvsc_req->sector_start); - *(unsigned int *)&blkvsc_req->cmnd[10] - cpu_to_be32(blkvsc_req->sector_count); - } else if ((blkvsc_req->sector_count > 0xff) || - (blkvsc_req->sector_start > 0x1fffff)) { - if (rq_data_dir(blkvsc_req->req)) { - blkvsc_req->write = 1; - blkvsc_req->cmnd[0] = WRITE_10; - } else { - blkvsc_req->write = 0; - blkvsc_req->cmnd[0] = READ_10; - } - - blkvsc_req->cmnd[1] |- (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0; - - *(unsigned int *)&blkvsc_req->cmnd[2] - cpu_to_be32(blkvsc_req->sector_start); - *(unsigned short *)&blkvsc_req->cmnd[7] - cpu_to_be16(blkvsc_req->sector_count); - } else { - if (rq_data_dir(blkvsc_req->req)) { - blkvsc_req->write = 1; - blkvsc_req->cmnd[0] = WRITE_6; - } else { - blkvsc_req->write = 0; - blkvsc_req->cmnd[0] = READ_6; - } - - *(unsigned int *)&blkvsc_req->cmnd[1] - cpu_to_be32(blkvsc_req->sector_start) >> 8; - blkvsc_req->cmnd[1] &= 0x1f; - blkvsc_req->cmnd[4] = (unsigned char)blkvsc_req->sector_count; - } -} - - /* * We break the request into 1 or more blkvsc_requests and submit * them. If we can't submit them all, we put them on the -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 02/18] Staging: hv: Get rid of the forward declaration of blkvsc_ioctl()
Get rid of the forward declaration of blkvsc_ioctl() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 56 ++++++++++++++++++-------------------- 1 files changed, 27 insertions(+), 29 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index f4f6545..a0d3d6c 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -407,6 +407,33 @@ static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) } +static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, + unsigned cmd, unsigned long argument) +{ +/* struct block_device_context *blkdev = bd->bd_disk->private_data; */ + int ret; + + switch (cmd) { + /* + * TODO: I think there is certain format for HDIO_GET_IDENTITY rather + * than just a GUID. Commented it out for now. + */ +#if 0 + case HDIO_GET_IDENTITY: + DPRINT_INFO(BLKVSC_DRV, "HDIO_GET_IDENTITY\n"); + if (copy_to_user((void __user *)arg, blkdev->device_id, + blkdev->device_id_len)) + ret = -EFAULT; + break; +#endif + default: + ret = -EINVAL; + break; + } + + return ret; +} + /* Static decl */ static int blkvsc_probe(struct device *dev); static int blkvsc_remove(struct device *device); @@ -414,8 +441,6 @@ static void blkvsc_shutdown(struct device *device); static int blkvsc_release(struct gendisk *disk, fmode_t mode); static int blkvsc_revalidate_disk(struct gendisk *gd); -static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, - unsigned cmd, unsigned long argument); static void blkvsc_request(struct request_queue *queue); static void blkvsc_request_completion(struct hv_storvsc_request *request); static int blkvsc_do_request(struct block_device_context *blkdev, @@ -1499,33 +1524,6 @@ static int blkvsc_revalidate_disk(struct gendisk *gd) return 0; } -static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, - unsigned cmd, unsigned long argument) -{ -/* struct block_device_context *blkdev = bd->bd_disk->private_data; */ - int ret; - - switch (cmd) { - /* - * TODO: I think there is certain format for HDIO_GET_IDENTITY rather - * than just a GUID. Commented it out for now. - */ -#if 0 - case HDIO_GET_IDENTITY: - DPRINT_INFO(BLKVSC_DRV, "HDIO_GET_IDENTITY\n"); - if (copy_to_user((void __user *)arg, blkdev->device_id, - blkdev->device_id_len)) - ret = -EFAULT; - break; -#endif - default: - ret = -EINVAL; - break; - } - - return ret; -} - static int __init blkvsc_init(void) { int ret; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 03/18] Staging: hv: Get rid of the forward declaration of blkvsc_cmd_completion()
Get rid of the forward declaration of blkvsc_cmd_completion() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 48 +++++++++++++++++++------------------- 1 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index a0d3d6c..197955c 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -434,6 +434,30 @@ static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, return ret; } +static void blkvsc_cmd_completion(struct hv_storvsc_request *request) +{ + struct blkvsc_request *blkvsc_req + (struct blkvsc_request *)request->context; + struct block_device_context *blkdev + (struct block_device_context *)blkvsc_req->dev; + struct scsi_sense_hdr sense_hdr; + struct vmscsi_request *vm_srb; + + DPRINT_DBG(BLKVSC_DRV, "blkvsc_cmd_completion() - req %p\n", + blkvsc_req); + + vm_srb = &blkvsc_req->request.vstor_packet.vm_srb; + blkdev->num_outstanding_reqs--; + + if (vm_srb->scsi_status) + if (scsi_normalize_sense(blkvsc_req->sense_buffer, + SCSI_SENSE_BUFFERSIZE, &sense_hdr)) + scsi_print_sense_hdr("blkvsc", &sense_hdr); + + complete(&blkvsc_req->request.wait_event); +} + + /* Static decl */ static int blkvsc_probe(struct device *dev); static int blkvsc_remove(struct device *device); @@ -445,7 +469,6 @@ static void blkvsc_request(struct request_queue *queue); static void blkvsc_request_completion(struct hv_storvsc_request *request); static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req); -static void blkvsc_cmd_completion(struct hv_storvsc_request *request); static int blkvsc_do_inquiry(struct block_device_context *blkdev); static int blkvsc_do_read_capacity(struct block_device_context *blkdev); static int blkvsc_do_read_capacity16(struct block_device_context *blkdev); @@ -1248,29 +1271,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev, return pending; } -static void blkvsc_cmd_completion(struct hv_storvsc_request *request) -{ - struct blkvsc_request *blkvsc_req - (struct blkvsc_request *)request->context; - struct block_device_context *blkdev - (struct block_device_context *)blkvsc_req->dev; - struct scsi_sense_hdr sense_hdr; - struct vmscsi_request *vm_srb; - - DPRINT_DBG(BLKVSC_DRV, "blkvsc_cmd_completion() - req %p\n", - blkvsc_req); - - vm_srb = &blkvsc_req->request.vstor_packet.vm_srb; - blkdev->num_outstanding_reqs--; - - if (vm_srb->scsi_status) - if (scsi_normalize_sense(blkvsc_req->sense_buffer, - SCSI_SENSE_BUFFERSIZE, &sense_hdr)) - scsi_print_sense_hdr("blkvsc", &sense_hdr); - - complete(&blkvsc_req->request.wait_event); -} - static void blkvsc_request_completion(struct hv_storvsc_request *request) { struct blkvsc_request *blkvsc_req -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 04/18] Staging: hv: Get rid of the forward declaration of blkvsc_do_flush()
Get rid of the forward declaration of blkvsc_do_flush() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 71 +++++++++++++++++++-------------------- 1 files changed, 35 insertions(+), 36 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 197955c..1ca84b5 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -457,6 +457,41 @@ static void blkvsc_cmd_completion(struct hv_storvsc_request *request) complete(&blkvsc_req->request.wait_event); } +static int blkvsc_do_flush(struct block_device_context *blkdev) +{ + struct blkvsc_request *blkvsc_req; + + DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_flush()\n"); + + if (blkdev->device_type != HARDDISK_TYPE) + return 0; + + blkvsc_req = kmem_cache_zalloc(blkdev->request_pool, GFP_KERNEL); + if (!blkvsc_req) + return -ENOMEM; + + memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); + init_completion(&blkvsc_req->request.wait_event); + blkvsc_req->dev = blkdev; + blkvsc_req->req = NULL; + blkvsc_req->write = 0; + + blkvsc_req->request.data_buffer.pfn_array[0] = 0; + blkvsc_req->request.data_buffer.offset = 0; + blkvsc_req->request.data_buffer.len = 0; + + blkvsc_req->cmnd[0] = SYNCHRONIZE_CACHE; + blkvsc_req->cmd_len = 10; + + blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); + + wait_for_completion_interruptible(&blkvsc_req->request.wait_event); + + kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); + + return 0; +} + /* Static decl */ static int blkvsc_probe(struct device *dev); @@ -472,7 +507,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev, static int blkvsc_do_inquiry(struct block_device_context *blkdev); static int blkvsc_do_read_capacity(struct block_device_context *blkdev); static int blkvsc_do_read_capacity16(struct block_device_context *blkdev); -static int blkvsc_do_flush(struct block_device_context *blkdev); static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev); static int blkvsc_do_pending_reqs(struct block_device_context *blkdev); @@ -762,41 +796,6 @@ static void blkvsc_shutdown(struct device *device) spin_unlock_irqrestore(&blkdev->lock, flags); } -static int blkvsc_do_flush(struct block_device_context *blkdev) -{ - struct blkvsc_request *blkvsc_req; - - DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_flush()\n"); - - if (blkdev->device_type != HARDDISK_TYPE) - return 0; - - blkvsc_req = kmem_cache_zalloc(blkdev->request_pool, GFP_KERNEL); - if (!blkvsc_req) - return -ENOMEM; - - memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); - init_completion(&blkvsc_req->request.wait_event); - blkvsc_req->dev = blkdev; - blkvsc_req->req = NULL; - blkvsc_req->write = 0; - - blkvsc_req->request.data_buffer.pfn_array[0] = 0; - blkvsc_req->request.data_buffer.offset = 0; - blkvsc_req->request.data_buffer.len = 0; - - blkvsc_req->cmnd[0] = SYNCHRONIZE_CACHE; - blkvsc_req->cmd_len = 10; - - blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); - - wait_for_completion_interruptible(&blkvsc_req->request.wait_event); - - kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); - - return 0; -} - /* Do a scsi INQUIRY cmd here to get the device type (ie disk or dvd) */ static int blkvsc_do_inquiry(struct block_device_context *blkdev) { -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 07/18] Staging: hv: Get rid of the forward declaration of blkvsc_shutdown()
Get rid of the forward declaration of blkvsc_shutdown() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 70 +++++++++++++++++++-------------------- 1 files changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 0669b84..15304d4 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -637,10 +637,42 @@ static int blkvsc_remove(struct device *device) return ret; } +static void blkvsc_shutdown(struct device *device) +{ + struct block_device_context *blkdev = dev_get_drvdata(device); + unsigned long flags; + + if (!blkdev) + return; + + DPRINT_DBG(BLKVSC_DRV, "blkvsc_shutdown - users %d disk %s\n", + blkdev->users, blkdev->gd->disk_name); + + spin_lock_irqsave(&blkdev->lock, flags); + + blkdev->shutting_down = 1; + + blk_stop_queue(blkdev->gd->queue); + + spin_unlock_irqrestore(&blkdev->lock, flags); + + while (blkdev->num_outstanding_reqs) { + DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", + blkdev->num_outstanding_reqs); + udelay(100); + } + + blkvsc_do_flush(blkdev); + + spin_lock_irqsave(&blkdev->lock, flags); + + blkvsc_cancel_pending_reqs(blkdev); + + spin_unlock_irqrestore(&blkdev->lock, flags); +} + /* Static decl */ static int blkvsc_probe(struct device *dev); -static void blkvsc_shutdown(struct device *device); - static int blkvsc_release(struct gendisk *disk, fmode_t mode); static int blkvsc_revalidate_disk(struct gendisk *gd); static void blkvsc_request(struct request_queue *queue); @@ -904,40 +936,6 @@ Cleanup: return ret; } -static void blkvsc_shutdown(struct device *device) -{ - struct block_device_context *blkdev = dev_get_drvdata(device); - unsigned long flags; - - if (!blkdev) - return; - - DPRINT_DBG(BLKVSC_DRV, "blkvsc_shutdown - users %d disk %s\n", - blkdev->users, blkdev->gd->disk_name); - - spin_lock_irqsave(&blkdev->lock, flags); - - blkdev->shutting_down = 1; - - blk_stop_queue(blkdev->gd->queue); - - spin_unlock_irqrestore(&blkdev->lock, flags); - - while (blkdev->num_outstanding_reqs) { - DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", - blkdev->num_outstanding_reqs); - udelay(100); - } - - blkvsc_do_flush(blkdev); - - spin_lock_irqsave(&blkdev->lock, flags); - - blkvsc_cancel_pending_reqs(blkdev); - - spin_unlock_irqrestore(&blkdev->lock, flags); -} - /* Do a scsi INQUIRY cmd here to get the device type (ie disk or dvd) */ static int blkvsc_do_inquiry(struct block_device_context *blkdev) { -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 08/18] Staging: hv: Get rid of the forward declaration for blkvsc_release()
Get rid of the forward declaration for blkvsc_release() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 45 +++++++++++++++++++-------------------- 1 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 15304d4..d863dbd 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -671,9 +671,30 @@ static void blkvsc_shutdown(struct device *device) spin_unlock_irqrestore(&blkdev->lock, flags); } +static int blkvsc_release(struct gendisk *disk, fmode_t mode) +{ + struct block_device_context *blkdev = disk->private_data; + + DPRINT_DBG(BLKVSC_DRV, "- users %d disk %s\n", blkdev->users, + blkdev->gd->disk_name); + + mutex_lock(&blkvsc_mutex); + spin_lock(&blkdev->lock); + if (blkdev->users == 1) { + spin_unlock(&blkdev->lock); + blkvsc_do_flush(blkdev); + spin_lock(&blkdev->lock); + } + + blkdev->users--; + + spin_unlock(&blkdev->lock); + mutex_unlock(&blkvsc_mutex); + return 0; +} + /* Static decl */ static int blkvsc_probe(struct device *dev); -static int blkvsc_release(struct gendisk *disk, fmode_t mode); static int blkvsc_revalidate_disk(struct gendisk *gd); static void blkvsc_request(struct request_queue *queue); static void blkvsc_request_completion(struct hv_storvsc_request *request); @@ -1483,28 +1504,6 @@ static void blkvsc_request(struct request_queue *queue) } } -static int blkvsc_release(struct gendisk *disk, fmode_t mode) -{ - struct block_device_context *blkdev = disk->private_data; - - DPRINT_DBG(BLKVSC_DRV, "- users %d disk %s\n", blkdev->users, - blkdev->gd->disk_name); - - mutex_lock(&blkvsc_mutex); - spin_lock(&blkdev->lock); - if (blkdev->users == 1) { - spin_unlock(&blkdev->lock); - blkvsc_do_flush(blkdev); - spin_lock(&blkdev->lock); - } - - blkdev->users--; - - spin_unlock(&blkdev->lock); - mutex_unlock(&blkvsc_mutex); - return 0; -} - static int blkvsc_revalidate_disk(struct gendisk *gd) { struct block_device_context *blkdev = gd->private_data; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 09/18] Staging: hv: Get rid of the forward declaration for blkvsc_do_read_capacity()
Get rid of the forward declaration for blkvsc_do_read_capacity() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 152 +++++++++++++++++++------------------- 1 files changed, 76 insertions(+), 76 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index d863dbd..21be2ab 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -693,6 +693,82 @@ static int blkvsc_release(struct gendisk *disk, fmode_t mode) return 0; } + +/* Do a scsi READ_CAPACITY cmd here to get the size of the disk */ +static int blkvsc_do_read_capacity(struct block_device_context *blkdev) +{ + struct blkvsc_request *blkvsc_req; + struct page *page_buf; + unsigned char *buf; + struct scsi_sense_hdr sense_hdr; + struct vmscsi_request *vm_srb; + + DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_read_capacity()\n"); + + blkdev->sector_size = 0; + blkdev->capacity = 0; + blkdev->media_not_present = 0; /* assume a disk is present */ + + blkvsc_req = kmem_cache_zalloc(blkdev->request_pool, GFP_KERNEL); + if (!blkvsc_req) + return -ENOMEM; + + memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); + page_buf = alloc_page(GFP_KERNEL); + if (!page_buf) { + kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); + return -ENOMEM; + } + + vm_srb = &blkvsc_req->request.vstor_packet.vm_srb; + init_completion(&blkvsc_req->request.wait_event); + blkvsc_req->dev = blkdev; + blkvsc_req->req = NULL; + blkvsc_req->write = 0; + + blkvsc_req->request.data_buffer.pfn_array[0] + page_to_pfn(page_buf); + blkvsc_req->request.data_buffer.offset = 0; + blkvsc_req->request.data_buffer.len = 8; + + blkvsc_req->cmnd[0] = READ_CAPACITY; + blkvsc_req->cmd_len = 16; + + blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); + + DPRINT_DBG(BLKVSC_DRV, "waiting %p to complete\n", + blkvsc_req); + + wait_for_completion_interruptible(&blkvsc_req->request.wait_event); + + /* check error */ + if (vm_srb->scsi_status) { + scsi_normalize_sense(blkvsc_req->sense_buffer, + SCSI_SENSE_BUFFERSIZE, &sense_hdr); + + if (sense_hdr.asc == 0x3A) { + /* Medium not present */ + blkdev->media_not_present = 1; + } + return 0; + } + buf = kmap(page_buf); + + /* be to le */ + blkdev->capacity = ((buf[0] << 24) | (buf[1] << 16) | + (buf[2] << 8) | buf[3]) + 1; + blkdev->sector_size = (buf[4] << 24) | (buf[5] << 16) | + (buf[6] << 8) | buf[7]; + + kunmap(page_buf); + + __free_page(page_buf); + + kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); + + return 0; +} + /* Static decl */ static int blkvsc_probe(struct device *dev); static int blkvsc_revalidate_disk(struct gendisk *gd); @@ -701,7 +777,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request); static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req); static int blkvsc_do_inquiry(struct block_device_context *blkdev); -static int blkvsc_do_read_capacity(struct block_device_context *blkdev); static int blkvsc_do_read_capacity16(struct block_device_context *blkdev); static int blkvsc_do_pending_reqs(struct block_device_context *blkdev); @@ -1035,81 +1110,6 @@ static int blkvsc_do_inquiry(struct block_device_context *blkdev) return 0; } -/* Do a scsi READ_CAPACITY cmd here to get the size of the disk */ -static int blkvsc_do_read_capacity(struct block_device_context *blkdev) -{ - struct blkvsc_request *blkvsc_req; - struct page *page_buf; - unsigned char *buf; - struct scsi_sense_hdr sense_hdr; - struct vmscsi_request *vm_srb; - - DPRINT_DBG(BLKVSC_DRV, "blkvsc_do_read_capacity()\n"); - - blkdev->sector_size = 0; - blkdev->capacity = 0; - blkdev->media_not_present = 0; /* assume a disk is present */ - - blkvsc_req = kmem_cache_zalloc(blkdev->request_pool, GFP_KERNEL); - if (!blkvsc_req) - return -ENOMEM; - - memset(blkvsc_req, 0, sizeof(struct blkvsc_request)); - page_buf = alloc_page(GFP_KERNEL); - if (!page_buf) { - kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); - return -ENOMEM; - } - - vm_srb = &blkvsc_req->request.vstor_packet.vm_srb; - init_completion(&blkvsc_req->request.wait_event); - blkvsc_req->dev = blkdev; - blkvsc_req->req = NULL; - blkvsc_req->write = 0; - - blkvsc_req->request.data_buffer.pfn_array[0] - page_to_pfn(page_buf); - blkvsc_req->request.data_buffer.offset = 0; - blkvsc_req->request.data_buffer.len = 8; - - blkvsc_req->cmnd[0] = READ_CAPACITY; - blkvsc_req->cmd_len = 16; - - blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion); - - DPRINT_DBG(BLKVSC_DRV, "waiting %p to complete\n", - blkvsc_req); - - wait_for_completion_interruptible(&blkvsc_req->request.wait_event); - - /* check error */ - if (vm_srb->scsi_status) { - scsi_normalize_sense(blkvsc_req->sense_buffer, - SCSI_SENSE_BUFFERSIZE, &sense_hdr); - - if (sense_hdr.asc == 0x3A) { - /* Medium not present */ - blkdev->media_not_present = 1; - } - return 0; - } - buf = kmap(page_buf); - - /* be to le */ - blkdev->capacity = ((buf[0] << 24) | (buf[1] << 16) | - (buf[2] << 8) | buf[3]) + 1; - blkdev->sector_size = (buf[4] << 24) | (buf[5] << 16) | - (buf[6] << 8) | buf[7]; - - kunmap(page_buf); - - __free_page(page_buf); - - kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); - - return 0; -} - static int blkvsc_do_read_capacity16(struct block_device_context *blkdev) { struct blkvsc_request *blkvsc_req; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 11/18] Staging: hv: Get rid of the forward declaration of blkvsc_revalidate_disk()
Get rid of the forward declaration of blkvsc_revalidate_disk() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 31 +++++++++++++++---------------- 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 900ffc1..2094d00 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -853,9 +853,23 @@ static int blkvsc_do_read_capacity16(struct block_device_context *blkdev) return 0; } +static int blkvsc_revalidate_disk(struct gendisk *gd) +{ + struct block_device_context *blkdev = gd->private_data; + + DPRINT_DBG(BLKVSC_DRV, "- enter\n"); + + if (blkdev->device_type == DVD_TYPE) { + blkvsc_do_read_capacity(blkdev); + set_capacity(blkdev->gd, blkdev->capacity * + (blkdev->sector_size/512)); + blk_queue_logical_block_size(gd->queue, blkdev->sector_size); + } + return 0; +} + /* Static decl */ static int blkvsc_probe(struct device *dev); -static int blkvsc_revalidate_disk(struct gendisk *gd); static void blkvsc_request(struct request_queue *queue); static void blkvsc_request_completion(struct hv_storvsc_request *request); static int blkvsc_do_request(struct block_device_context *blkdev, @@ -1504,21 +1518,6 @@ static void blkvsc_request(struct request_queue *queue) } } -static int blkvsc_revalidate_disk(struct gendisk *gd) -{ - struct block_device_context *blkdev = gd->private_data; - - DPRINT_DBG(BLKVSC_DRV, "- enter\n"); - - if (blkdev->device_type == DVD_TYPE) { - blkvsc_do_read_capacity(blkdev); - set_capacity(blkdev->gd, blkdev->capacity * - (blkdev->sector_size/512)); - blk_queue_logical_block_size(gd->queue, blkdev->sector_size); - } - return 0; -} - static int __init blkvsc_init(void) { int ret; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 14/18] Staging: hv: Get rid of the forward declaration for blkvsc_do_pending_reqs()
Get rid of the forward declaration for blkvsc_do_pending_reqs() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 45 +++++++++++++++++++-------------------- 1 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 0b5622e..5252948 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -1140,10 +1140,31 @@ static int blkvsc_do_request(struct block_device_context *blkdev, return pending; } +static int blkvsc_do_pending_reqs(struct block_device_context *blkdev) +{ + struct blkvsc_request *pend_req, *tmp; + int ret = 0; + + /* Flush the pending list first */ + list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list, + pend_entry) { + DPRINT_DBG(BLKVSC_DRV, "working off pending_list - %p\n", + pend_req); + + ret = blkvsc_submit_request(pend_req, + blkvsc_request_completion); + if (ret != 0) + break; + else + list_del(&pend_req->pend_entry); + } + + return ret; +} + /* Static decl */ static int blkvsc_probe(struct device *dev); static void blkvsc_request(struct request_queue *queue); -static int blkvsc_do_pending_reqs(struct block_device_context *blkdev); static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; module_param(blkvsc_ringbuffer_size, int, S_IRUGO); @@ -1470,28 +1491,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request) spin_unlock_irqrestore(&blkdev->lock, flags); } -static int blkvsc_do_pending_reqs(struct block_device_context *blkdev) -{ - struct blkvsc_request *pend_req, *tmp; - int ret = 0; - - /* Flush the pending list first */ - list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list, - pend_entry) { - DPRINT_DBG(BLKVSC_DRV, "working off pending_list - %p\n", - pend_req); - - ret = blkvsc_submit_request(pend_req, - blkvsc_request_completion); - if (ret != 0) - break; - else - list_del(&pend_req->pend_entry); - } - - return ret; -} - static void blkvsc_request(struct request_queue *queue) { struct block_device_context *blkdev = NULL; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 15/18] Staging: hv: Get rid of the forward declaration for blkvsc_request()
Get rid of the forward declaration for blkvsc_request() by moving the code around. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 86 +++++++++++++++++++------------------- 1 files changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 5252948..a63778e4 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -1162,9 +1162,51 @@ static int blkvsc_do_pending_reqs(struct block_device_context *blkdev) return ret; } + +static void blkvsc_request(struct request_queue *queue) +{ + struct block_device_context *blkdev = NULL; + struct request *req; + int ret = 0; + + DPRINT_DBG(BLKVSC_DRV, "- enter\n"); + while ((req = blk_peek_request(queue)) != NULL) { + DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req); + + blkdev = req->rq_disk->private_data; + if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS || + blkdev->media_not_present) { + __blk_end_request_cur(req, 0); + continue; + } + + ret = blkvsc_do_pending_reqs(blkdev); + + if (ret != 0) { + DPRINT_DBG(BLKVSC_DRV, + "- stop queue - pending_list not empty\n"); + blk_stop_queue(queue); + break; + } + + blk_start_request(req); + + ret = blkvsc_do_request(blkdev, req); + if (ret > 0) { + DPRINT_DBG(BLKVSC_DRV, "- stop queue - no room\n"); + blk_stop_queue(queue); + break; + } else if (ret < 0) { + DPRINT_DBG(BLKVSC_DRV, "- stop queue - no mem\n"); + blk_requeue_request(queue, req); + blk_stop_queue(queue); + break; + } + } +} + /* Static decl */ static int blkvsc_probe(struct device *dev); -static void blkvsc_request(struct request_queue *queue); static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; module_param(blkvsc_ringbuffer_size, int, S_IRUGO); @@ -1491,48 +1533,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request) spin_unlock_irqrestore(&blkdev->lock, flags); } -static void blkvsc_request(struct request_queue *queue) -{ - struct block_device_context *blkdev = NULL; - struct request *req; - int ret = 0; - - DPRINT_DBG(BLKVSC_DRV, "- enter\n"); - while ((req = blk_peek_request(queue)) != NULL) { - DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req); - - blkdev = req->rq_disk->private_data; - if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS || - blkdev->media_not_present) { - __blk_end_request_cur(req, 0); - continue; - } - - ret = blkvsc_do_pending_reqs(blkdev); - - if (ret != 0) { - DPRINT_DBG(BLKVSC_DRV, - "- stop queue - pending_list not empty\n"); - blk_stop_queue(queue); - break; - } - - blk_start_request(req); - - ret = blkvsc_do_request(blkdev, req); - if (ret > 0) { - DPRINT_DBG(BLKVSC_DRV, "- stop queue - no room\n"); - blk_stop_queue(queue); - break; - } else if (ret < 0) { - DPRINT_DBG(BLKVSC_DRV, "- stop queue - no mem\n"); - blk_requeue_request(queue, req); - blk_stop_queue(queue); - break; - } - } -} - static int __init blkvsc_init(void) { int ret; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 16/18] Staging: hv: Move some definitions/declarations to be earlier in the file
Move some definitions/declarations to be earlier in the file. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index a63778e4..f421208 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -124,6 +124,14 @@ static const struct hv_guid g_blk_device_type = { */ static void blkvsc_request_completion(struct hv_storvsc_request *request); +static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; + +/* + * There is a circular dependency involving blkvsc_probe() + * and block_ops. + */ +static int blkvsc_probe(struct device *dev); + static int blk_vsc_on_device_add(struct hv_device *device, void *additional_info) { @@ -1205,10 +1213,7 @@ static void blkvsc_request(struct request_queue *queue) } } -/* Static decl */ -static int blkvsc_probe(struct device *dev); -static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; module_param(blkvsc_ringbuffer_size, int, S_IRUGO); MODULE_PARM_DESC(ring_size, "Ring buffer size (in bytes)"); -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 17/18] Staging: hv: Move module parameter to earlier in the file
Move module parameter to be earlier in the file. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index f421208..0177c45 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -126,6 +126,9 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request); static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; +module_param(blkvsc_ringbuffer_size, int, S_IRUGO); +MODULE_PARM_DESC(ring_size, "Ring buffer size (in bytes)"); + /* * There is a circular dependency involving blkvsc_probe() * and block_ops. @@ -1214,9 +1217,6 @@ static void blkvsc_request(struct request_queue *queue) } -module_param(blkvsc_ringbuffer_size, int, S_IRUGO); -MODULE_PARM_DESC(ring_size, "Ring buffer size (in bytes)"); - /* The one and only one */ static struct storvsc_driver_object g_blkvsc_drv; -- 1.7.4.1
K. Y. Srinivasan
2011-Apr-22 21:13 UTC
[PATCH 18/18] Staging: hv: Get rid of some dead code in blkvsc_drv.c
Get rid of some dead code in blkvsc_drv.c. Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: Abhishek Kane <v-abkane at microsoft.com> Signed-off-by: Hank Janssen <hjanssen at microsoft.com> --- drivers/staging/hv/blkvsc_drv.c | 26 -------------------------- 1 files changed, 0 insertions(+), 26 deletions(-) diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 0177c45..3a344d2 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -172,7 +172,6 @@ static int blk_vsc_initialize(struct hv_driver *driver) stor_driver = hvdr_to_stordr(driver); /* Make sure we are at least 2 pages since 1 page is used for control */ - /* ASSERT(stor_driver->RingBufferSize >= (PAGE_SIZE << 1)); */ driver->name = g_blk_driver_name; memcpy(&driver->dev_type, &g_blk_device_type, sizeof(struct hv_guid)); @@ -224,14 +223,6 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, blkvsc_req->sector_count, blkvsc_req->request.data_buffer.offset, blkvsc_req->request.data_buffer.len); -#if 0 - for (i = 0; i < (blkvsc_req->request.data_buffer.len >> 12); i++) { - DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - " - "req %p pfn[%d] %llx\n", - blkvsc_req, i, - blkvsc_req->request.data_buffer.pfn_array[i]); - } -#endif storvsc_req = &blkvsc_req->request; vm_srb = &storvsc_req->vstor_packet.vm_srb; @@ -368,9 +359,6 @@ static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg) static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) { - /* ASSERT(blkvsc_req->req); */ - /* ASSERT(blkvsc_req->sector_count <- (MAX_MULTIPAGE_BUFFER_COUNT*8)); */ blkvsc_req->cmd_len = 16; @@ -427,7 +415,6 @@ static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, unsigned cmd, unsigned long argument) { -/* struct block_device_context *blkdev = bd->bd_disk->private_data; */ int ret; switch (cmd) { @@ -854,13 +841,6 @@ static int blkvsc_do_read_capacity16(struct block_device_context *blkdev) blkdev->capacity = be64_to_cpu(*(unsigned long long *) &buf[0]) + 1; blkdev->sector_size = be32_to_cpu(*(unsigned int *)&buf[8]); -#if 0 - blkdev->capacity = ((buf[0] << 24) | (buf[1] << 16) | - (buf[2] << 8) | buf[3]) + 1; - blkdev->sector_size = (buf[4] << 24) | (buf[5] << 16) | - (buf[6] << 8) | buf[7]; -#endif - kunmap(page_buf); __free_page(page_buf); @@ -932,7 +912,6 @@ static int blkvsc_do_inquiry(struct block_device_context *blkdev) buf = kmap(page_buf); - /* print_hex_dump_bytes("", DUMP_PREFIX_NONE, buf, 64); */ /* be to le */ device_type = buf[0] & 0x1F; @@ -952,8 +931,6 @@ static int blkvsc_do_inquiry(struct block_device_context *blkdev) blkdev->device_id_len = 64; memcpy(blkdev->device_id, &buf[8], blkdev->device_id_len); - /* printk_hex_dump_bytes("", DUMP_PREFIX_NONE, blkdev->device_id, - * blkdev->device_id_len); */ kunmap(page_buf); @@ -1337,8 +1314,6 @@ static int blkvsc_probe(struct device *device) /* Initialize what we can here */ spin_lock_init(&blkdev->lock); - /* ASSERT(sizeof(struct blkvsc_request_group) <= */ - /* sizeof(struct blkvsc_request)); */ blkdev->request_pool = kmem_cache_create(dev_name(&device_obj->device), sizeof(struct blkvsc_request), 0, @@ -1475,7 +1450,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request) struct blkvsc_request *comp_req, *tmp; struct vmscsi_request *vm_srb; - /* ASSERT(blkvsc_req->group); */ DPRINT_DBG(BLKVSC_DRV, "blkdev %p blkvsc_req %p group %p type %s " "sect_start %lu sect_count %ld len %d group outstd %d " -- 1.7.4.1
Maybe Matching Threads
- [PATCH 00/22] Staging: hv: Cleanup-storage-drivers-phase-III
- [PATCH 00/22] Staging: hv: Cleanup-storage-drivers-phase-III
- [RESEND] [PATCH 00/18] Staging: hv: Cleanup-storage-drivers-phase-III
- [RESEND][PATCH 00/22] Staging: hv: Cleanup storage drivers - Phase IV
- [RESEND][PATCH 00/22] Staging: hv: Cleanup storage drivers - Phase IV