[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/41] block/replication: drop extra synchronization
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 05/41] block/replication: drop extra synchronization |
Date: |
Wed, 12 Dec 2018 14:26:59 +0100 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
After commit f8d59dfb40
"block/backup: fix fleecing scheme: use serialized writes" fleecing
(specifically reading from backup target, when backup source is in
backing chain of backup target) is safe, because all backup-job writes
to target are serialized. Therefore we don't need additional
synchronization for these reads.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/replication.c | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/block/replication.c b/block/replication.c
index 6349d6958e..0c2989d2cb 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -218,9 +218,6 @@ static coroutine_fn int
replication_co_readv(BlockDriverState *bs,
QEMUIOVector *qiov)
{
BDRVReplicationState *s = bs->opaque;
- BdrvChild *child = s->secondary_disk;
- BlockJob *job = NULL;
- CowRequest req;
int ret;
if (s->mode == REPLICATION_MODE_PRIMARY) {
@@ -233,28 +230,9 @@ static coroutine_fn int
replication_co_readv(BlockDriverState *bs,
return ret;
}
- if (child && child->bs) {
- job = child->bs->job;
- }
-
- if (job) {
- uint64_t remaining_bytes = remaining_sectors * BDRV_SECTOR_SIZE;
-
- backup_wait_for_overlapping_requests(child->bs->job,
- sector_num * BDRV_SECTOR_SIZE,
- remaining_bytes);
- backup_cow_request_begin(&req, child->bs->job,
- sector_num * BDRV_SECTOR_SIZE,
- remaining_bytes);
- ret = bdrv_co_preadv(bs->file, sector_num * BDRV_SECTOR_SIZE,
- remaining_bytes, qiov, 0);
- backup_cow_request_end(&req);
- goto out;
- }
-
ret = bdrv_co_preadv(bs->file, sector_num * BDRV_SECTOR_SIZE,
remaining_sectors * BDRV_SECTOR_SIZE, qiov, 0);
-out:
+
return replication_return_value(s, ret);
}
--
2.19.2
- [Qemu-devel] [PULL 00/41] Block layer patches, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 01/41] block: adding lzfse decompressing support as a module., Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 02/41] configure: adding support to lzfse library., Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 03/41] dmg: including dmg-lzfse module inside dmg block driver., Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 05/41] block/replication: drop extra synchronization,
Kevin Wolf <=
- [Qemu-devel] [PULL 04/41] dmg: exchanging hardcoded dmg UDIF block types to enum., Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 09/41] qcow2: move decompression from qcow2-cluster.c to qcow2.c, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 06/41] block/backup: drop unused synchronization interface, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 08/41] qcow2: make more generic interface for qcow2_compress, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 10/41] qcow2: refactor decompress_buffer, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 11/41] qcow2: use byte-based read in qcow2_decompress_cluster, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 07/41] qcow2: use Z_OK instead of 0 for deflateInit2 return code check, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 13/41] qcow2: do decompression in threads, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 12/41] qcow2: aio support for compressed cluster read, Kevin Wolf, 2018/12/12
- [Qemu-devel] [PULL 16/41] file-posix: Avoid aio_worker() for QEMU_AIO_TRUNCATE, Kevin Wolf, 2018/12/12