diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-06-16 14:43:19 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-06-26 14:51:15 +0200 |
commit | 0f714ec70673e734b4b0d5c99f7851c8d9e6fafe (patch) | |
tree | 1c820e84683dd194cfb0dab1b44800fcb900bbd5 /block/qed.c | |
parent | 87f0d88261d120e428cd23305775026556e6cce6 (diff) |
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>
Diffstat (limited to 'block/qed.c')
-rw-r--r-- | block/qed.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/block/qed.c b/block/qed.c index 48f2b0eb52..c073baa340 100644 --- a/block/qed.c +++ b/block/qed.c @@ -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; } |