Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259451
b: refs/heads/master
c: 3a45058
h: refs/heads/master
i:
  259449: 93a19de
  259447: ad412b4
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent a353f6f commit 672eca5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d7b18d1844fa0bd0f9c5da3c12c1315a3a465fd
refs/heads/master: 3a4505897ccaf387f4befa8c0d308d994bcdbc37
40 changes: 23 additions & 17 deletions trunk/drivers/staging/hv/blkvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,22 +518,18 @@ static int blkvsc_remove(struct hv_device *dev)

blkvsc_do_operation(blkdev, DO_FLUSH);

blk_cleanup_queue(blkdev->gd->queue);
if (blkdev->users == 0) {
del_gendisk(blkdev->gd);
put_disk(blkdev->gd);
blk_cleanup_queue(blkdev->gd->queue);

/*
* Call to the vsc driver to let it know that the device is being
* removed
*/
storvsc_dev_remove(dev);

del_gendisk(blkdev->gd);
storvsc_dev_remove(blkdev->device_ctx);

kmem_cache_destroy(blkdev->request_pool);

kfree(blkdev);
kmem_cache_destroy(blkdev->request_pool);
kfree(blkdev);
}

return 0;

}

static void blkvsc_shutdown(struct hv_device *dev)
Expand Down Expand Up @@ -568,13 +564,23 @@ static int blkvsc_release(struct gendisk *disk, fmode_t mode)
struct block_device_context *blkdev = disk->private_data;
unsigned long flags;

if (blkdev->users == 1) {
spin_lock_irqsave(&blkdev->lock, flags);

if ((--blkdev->users == 0) && (blkdev->shutting_down)) {
blk_stop_queue(blkdev->gd->queue);
spin_unlock_irqrestore(&blkdev->lock, flags);

blkvsc_do_operation(blkdev, DO_FLUSH);
}
del_gendisk(blkdev->gd);
put_disk(blkdev->gd);
blk_cleanup_queue(blkdev->gd->queue);

spin_lock_irqsave(&blkdev->lock, flags);
blkdev->users--;
spin_unlock_irqrestore(&blkdev->lock, flags);
storvsc_dev_remove(blkdev->device_ctx);

kmem_cache_destroy(blkdev->request_pool);
kfree(blkdev);
} else
spin_unlock_irqrestore(&blkdev->lock, flags);

return 0;
}
Expand Down

0 comments on commit 672eca5

Please sign in to comment.