hw/virtio-blk: add a constant for max number of merged requests
As it was not obvious (at least for me) where the 32 comes from; add a constant for it. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
f4564d53c6
commit
d901f3c457
|
@ -360,7 +360,7 @@ static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb)
|
||||||
block_acct_start(blk_get_stats(req->dev->blk), &req->acct, req->qiov.size,
|
block_acct_start(blk_get_stats(req->dev->blk), &req->acct, req->qiov.size,
|
||||||
BLOCK_ACCT_WRITE);
|
BLOCK_ACCT_WRITE);
|
||||||
|
|
||||||
if (mrb->num_writes == 32) {
|
if (mrb->num_writes == VIRTIO_BLK_MAX_MERGE_REQS) {
|
||||||
virtio_submit_multiwrite(req->dev->blk, mrb);
|
virtio_submit_multiwrite(req->dev->blk, mrb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,8 +134,10 @@ typedef struct VirtIOBlock {
|
||||||
struct VirtIOBlockDataPlane *dataplane;
|
struct VirtIOBlockDataPlane *dataplane;
|
||||||
} VirtIOBlock;
|
} VirtIOBlock;
|
||||||
|
|
||||||
|
#define VIRTIO_BLK_MAX_MERGE_REQS 32
|
||||||
|
|
||||||
typedef struct MultiReqBuffer {
|
typedef struct MultiReqBuffer {
|
||||||
BlockRequest blkreq[32];
|
BlockRequest blkreq[VIRTIO_BLK_MAX_MERGE_REQS];
|
||||||
unsigned int num_writes;
|
unsigned int num_writes;
|
||||||
} MultiReqBuffer;
|
} MultiReqBuffer;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue