Rusty Russell wrote:
> +static bool do_read(request_queue_t *q, struct virtio_blk *vblk,
> +                 struct virtblk_req *vbr)
> +{
> +     unsigned long num;
> +
> +     vbr->out_hdr.type |= VIRTIO_BLK_T_READ;
> +
> +     /* Set up for reply. */
> +     vblk->sg[0].page = virt_to_page(&vbr->in_hdr);
> +     vblk->sg[0].offset = offset_in_page(&vbr->in_hdr);
> +     vblk->sg[0].length = sizeof(vbr->in_hdr);
> +     num = blk_rq_map_sg(q, vbr->req, vblk->sg+1);
> +     vbr->out_hdr.id = vblk->vdev->ops->add_inbuf(vblk->vdev, vblk->sg,
> +                                                  1+num, vbr);
> +     if (IS_ERR_VALUE(vbr->out_hdr.id))
> +             goto full;
> +
> +     vblk->sg[0].page = virt_to_page(&vbr->out_hdr);
> +     vblk->sg[0].offset = offset_in_page(&vbr->out_hdr);
> +     vblk->sg[0].length = sizeof(vbr->out_hdr);
> +
> +     vbr->out_id = vblk->vdev->ops->add_outbuf(vblk->vdev, vblk->sg, 1,
> +                                               vbr);
>   

This strikes me as wasteful.  Why not set up a single descriptor which 
contains both placement and the data itself?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to