qed: Use bdrv_co_* for coroutine_fns

All functions that are marked coroutine_fn can directly call the
bdrv_co_* version of functions instead of going through the wrapper.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2017-06-16 14:43:19 +02:00
parent 87f0d88261
commit 0f714ec706

View file

@ -116,7 +116,7 @@ static int coroutine_fn qed_write_header(BDRVQEDState *s)
};
qemu_iovec_init_external(&qiov, &iov, 1);
ret = bdrv_preadv(s->bs->file, 0, &qiov);
ret = bdrv_co_preadv(s->bs->file, 0, qiov.size, &qiov, 0);
if (ret < 0) {
goto out;
}
@ -124,7 +124,7 @@ static int coroutine_fn qed_write_header(BDRVQEDState *s)
/* Update header */
qed_header_cpu_to_le(&s->header, (QEDHeader *) buf);
ret = bdrv_pwritev(s->bs->file, 0, &qiov);
ret = bdrv_co_pwritev(s->bs->file, 0, qiov.size, &qiov, 0);
if (ret < 0) {
goto out;
}
@ -796,7 +796,7 @@ static int coroutine_fn qed_read_backing_file(BDRVQEDState *s, uint64_t pos,
qemu_iovec_concat(*backing_qiov, qiov, 0, size);
BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO);
ret = bdrv_preadv(s->bs->backing, pos, *backing_qiov);
ret = bdrv_co_preadv(s->bs->backing, pos, size, *backing_qiov, 0);
if (ret < 0) {
return ret;
}
@ -844,7 +844,7 @@ static int coroutine_fn qed_copy_from_backing_file(BDRVQEDState *s,
}
BLKDBG_EVENT(s->bs->file, BLKDBG_COW_WRITE);
ret = bdrv_pwritev(s->bs->file, offset, &qiov);
ret = bdrv_co_pwritev(s->bs->file, offset, qiov.size, &qiov, 0);
if (ret < 0) {
goto out;
}
@ -987,7 +987,8 @@ static int coroutine_fn qed_aio_write_main(QEDAIOCB *acb)
trace_qed_aio_write_main(s, acb, 0, offset, acb->cur_qiov.size);
BLKDBG_EVENT(s->bs->file, BLKDBG_WRITE_AIO);
ret = bdrv_pwritev(s->bs->file, offset, &acb->cur_qiov);
ret = bdrv_co_pwritev(s->bs->file, offset, acb->cur_qiov.size,
&acb->cur_qiov, 0);
if (ret < 0) {
return ret;
}
@ -1004,7 +1005,7 @@ static int coroutine_fn qed_aio_write_main(QEDAIOCB *acb)
* region. The solution is to flush after writing a new data
* cluster and before updating the L2 table.
*/
ret = bdrv_flush(s->bs->file->bs);
ret = bdrv_co_flush(s->bs->file->bs);
if (ret < 0) {
return ret;
}
@ -1221,7 +1222,8 @@ static int coroutine_fn qed_aio_read_data(void *opaque, int ret,
}
BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
ret = bdrv_preadv(bs->file, offset, &acb->cur_qiov);
ret = bdrv_co_preadv(bs->file, offset, acb->cur_qiov.size,
&acb->cur_qiov, 0);
if (ret < 0) {
return ret;
}