[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 02/18] block/io: allow BDRV_REQ_SERIALISING for r
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-devel] [PATCH v3 02/18] block/io: allow BDRV_REQ_SERIALISING for read |
Date: |
Mon, 1 Oct 2018 13:29:12 +0300 |
It will be used in further commit, changing backup architecture.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block/io.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/block/io.c b/block/io.c
index bd9d688f8b..b003b4d5bf 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1318,10 +1318,11 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild
*child,
* potential fallback support, if we ever implement any read flags
* to pass through to drivers. For now, there aren't any
* passthrough flags. */
- assert(!(flags & ~(BDRV_REQ_NO_SERIALISING | BDRV_REQ_COPY_ON_READ)));
+ assert(!(flags & ~(BDRV_REQ_NO_SERIALISING | BDRV_REQ_COPY_ON_READ |
+ BDRV_REQ_SERIALISING)));
/* Handle Copy on Read and associated serialisation */
- if (flags & BDRV_REQ_COPY_ON_READ) {
+ if (flags & (BDRV_REQ_COPY_ON_READ | BDRV_REQ_SERIALISING)) {
/* If we touch the same cluster it counts as an overlap. This
* guarantees that allocating writes will be serialized and not race
* with each other for the same cluster. For example, in copy-on-read
@@ -1330,9 +1331,6 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild
*child,
mark_request_serialising(req, bdrv_get_cluster_size(bs));
}
- /* BDRV_REQ_SERIALISING is only for write operation */
- assert(!(flags & BDRV_REQ_SERIALISING));
-
if (!(flags & BDRV_REQ_NO_SERIALISING)) {
wait_serialising_requests(req);
}
@@ -3027,8 +3025,9 @@ static int coroutine_fn bdrv_co_copy_range_internal(
tracked_request_begin(&req, src->bs, src_offset, bytes,
BDRV_TRACKED_READ);
- /* BDRV_REQ_SERIALISING is only for write operation */
- assert(!(read_flags & BDRV_REQ_SERIALISING));
+ if (read_flags & BDRV_REQ_SERIALISING) {
+ mark_request_serialising(&req, bdrv_get_cluster_size(src->bs));
+ }
if (!(read_flags & BDRV_REQ_NO_SERIALISING)) {
wait_serialising_requests(&req);
}
--
2.18.0
- [Qemu-devel] [PATCH v3 00/18] fleecing-hook driver for backup, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 10/18] iotests: handle -f argument correctly for qemu_io_silent, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 04/18] block/backup: move from HBitmap to BdrvDirtyBitmap, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 08/18] block: allow serialized reads to intersect, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 02/18] block/io: allow BDRV_REQ_SERIALISING for read,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-devel] [PATCH v3 06/18] block/backup: give a name to copy-bitmap, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 03/18] block/backup: simplify backup_incremental_init_copy_bitmap, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 14/18] block/fleecing-hook: internal api, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 01/18] block/dirty-bitmap: allow set/reset bits in disabled bitmaps, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 05/18] util/id: add block-bitmap subsystem, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 13/18] block: introduce new filter driver: fleecing-hook, Vladimir Sementsov-Ogievskiy, 2018/10/01