Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319820
b: refs/heads/master
c: 483001c
h: refs/heads/master
v: v3
  • Loading branch information
Asias He authored and Rusty Russell committed Jul 30, 2012
1 parent 5ff799a commit 1783912
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 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: 02e2b124943648fba0a2ccee5c3656a5653e0151
refs/heads/master: 483001c765af6892b3fc3726576cb42f17d1d6b5
12 changes: 1 addition & 11 deletions trunk/drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,30 +576,20 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
int index = vblk->index;
struct virtblk_req *vbr;
unsigned long flags;

/* Prevent config work handler from accessing the device. */
mutex_lock(&vblk->config_lock);
vblk->config_enable = false;
mutex_unlock(&vblk->config_lock);

del_gendisk(vblk->disk);
blk_cleanup_queue(vblk->disk->queue);

/* Stop all the virtqueues. */
vdev->config->reset(vdev);

flush_work(&vblk->config_work);

/* Abort requests dispatched to driver. */
spin_lock_irqsave(&vblk->lock, flags);
while ((vbr = virtqueue_detach_unused_buf(vblk->vq))) {
__blk_end_request_all(vbr->req, -EIO);
mempool_free(vbr, vblk->pool);
}
spin_unlock_irqrestore(&vblk->lock, flags);

blk_cleanup_queue(vblk->disk->queue);
put_disk(vblk->disk);
mempool_destroy(vblk->pool);
vdev->config->del_vqs(vdev);
Expand Down

0 comments on commit 1783912

Please sign in to comment.