Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284249
b: refs/heads/master
c: 6abd6e5
h: refs/heads/master
i:
  284247: 935b357
v: v3
  • Loading branch information
Amit Shah authored and Rusty Russell committed Jan 12, 2012
1 parent cc43674 commit 9e7b0a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: c743d09dbd018dd6345519fb3264b16bdaa41746
refs/heads/master: 6abd6e5a4404056e28be04958a57d0286883161a
19 changes: 14 additions & 5 deletions trunk/drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,18 @@ static void virtblk_config_changed(struct virtio_device *vdev)
queue_work(virtblk_wq, &vblk->config_work);
}

static int init_vq(struct virtio_blk *vblk)
{
int err = 0;

/* We expect one virtqueue, for output. */
vblk->vq = virtio_find_single_vq(vblk->vdev, blk_done, "requests");
if (IS_ERR(vblk->vq))
err = PTR_ERR(vblk->vq);

return err;
}

static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
Expand Down Expand Up @@ -405,12 +417,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
INIT_WORK(&vblk->config_work, virtblk_config_changed_work);
vblk->config_enable = true;

/* We expect one virtqueue, for output. */
vblk->vq = virtio_find_single_vq(vdev, blk_done, "requests");
if (IS_ERR(vblk->vq)) {
err = PTR_ERR(vblk->vq);
err = init_vq(vblk);
if (err)
goto out_free_vblk;
}

vblk->pool = mempool_create_kmalloc_pool(1,sizeof(struct virtblk_req));
if (!vblk->pool) {
Expand Down

0 comments on commit 9e7b0a7

Please sign in to comment.