[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 54/61] qed: Use bdrv_co_* for coroutine_fns
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 54/61] qed: Use bdrv_co_* for coroutine_fns |
Date: |
Fri, 23 Jun 2017 18:21:52 +0200 |
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 <address@hidden>
Reviewed-by: Manos Pitsidianakis <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/qed.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/block/qed.c b/block/qed.c
index 48f2b0e..c073baa 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;
}
--
1.8.3.1
- [Qemu-block] [PULL 44/61] qed: Add return value to qed_aio_write_cow(), (continued)
- [Qemu-block] [PULL 44/61] qed: Add return value to qed_aio_write_cow(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 50/61] qed: Use CoQueue for serialising allocations, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 43/61] qed: Add return value to qed_aio_write_main(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 51/61] qed: Simplify request handling, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 45/61] qed: Add return value to qed_aio_write_inplace/alloc(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 46/61] qed: Add return value to qed_aio_read/write_data(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 48/61] qed: Remove recursion in qed_aio_next_io(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 49/61] qed: Implement .bdrv_co_readv/writev, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 53/61] qed: Add coroutine_fn to I/O path functions, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 52/61] qed: Use a coroutine for need_check_timer, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 54/61] qed: Use bdrv_co_* for coroutine_fns,
Kevin Wolf <=
- [Qemu-block] [PULL 55/61] block: Remove bdrv_aio_readv/writev/flush(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 57/61] fix: avoid an infinite loop or a dangling pointer problem in img_commit, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 58/61] blkdebug: Catch bs->exact_filename overflow, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 61/61] qemu-img: don't shadow opts variable in img_dd(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 59/61] blkverify: Catch bs->exact_filename overflow, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 60/61] block: Do not strcmp() with NULL uri->scheme, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 56/61] block: change variable names in BlockDriverState, Kevin Wolf, 2017/06/23
- Re: [Qemu-block] [Qemu-devel] [PULL 00/61] Block layer patches, Peter Maydell, 2017/06/26