提交 0eb1e891 编写于 作者: F Fam Zheng 提交者: Kevin Wolf

block: Use common req handling in copy offloading

This brings the request handling logic inline with write and discard,
fixing write_gen, resize_cb, dirty bitmaps and image size refreshing.
The last of these issues broke iotest case 222, which is now fixed.
Signed-off-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 00695c27
...@@ -3030,20 +3030,16 @@ static int coroutine_fn bdrv_co_copy_range_internal( ...@@ -3030,20 +3030,16 @@ static int coroutine_fn bdrv_co_copy_range_internal(
bdrv_inc_in_flight(dst->bs); bdrv_inc_in_flight(dst->bs);
tracked_request_begin(&req, dst->bs, dst_offset, bytes, tracked_request_begin(&req, dst->bs, dst_offset, bytes,
BDRV_TRACKED_WRITE); BDRV_TRACKED_WRITE);
ret = bdrv_co_write_req_prepare(dst, dst_offset, bytes, &req,
/* BDRV_REQ_NO_SERIALISING is only for read operation */ write_flags);
assert(!(write_flags & BDRV_REQ_NO_SERIALISING)); if (!ret) {
if (write_flags & BDRV_REQ_SERIALISING) { ret = dst->bs->drv->bdrv_co_copy_range_to(dst->bs,
mark_request_serialising(&req, bdrv_get_cluster_size(dst->bs)); src, src_offset,
} dst, dst_offset,
wait_serialising_requests(&req); bytes,
read_flags, write_flags);
ret = dst->bs->drv->bdrv_co_copy_range_to(dst->bs, }
src, src_offset, bdrv_co_write_req_finish(dst, dst_offset, bytes, &req, ret);
dst, dst_offset,
bytes,
read_flags, write_flags);
tracked_request_end(&req); tracked_request_end(&req);
bdrv_dec_in_flight(dst->bs); bdrv_dec_in_flight(dst->bs);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册