Rusty Russell wrote:
Hi Martin! I like this: moving the allocation into do_req() makes it even simpler: static void do_virtblk_request(request_queue_t *q) { struct virtio_blk *vblk = NULL; struct request *req; unsigned int issued = 0; while ((req = elv_next_request(q)) != NULL) { vblk = req->rq_disk->private_data; BUG_ON(req->nr_phys_segments > ARRAY_SIZE(vblk->sg)); if (!do_req(q, vblk, req)) { /* Queue full? Wait. */ blk_stop_queue(q); break; } blkdev_dequeue_request(req); issued++; } if (issued) vblk->vq->ops->sync(vblk->vq); }
ACK ;) Thanks, Martin _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/virtualization