aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2018-09-19 15:43:42 +0300
committerKevin Wolf <kwolf@redhat.com>2018-12-14 11:52:40 +0100
commite4f9752c4a9c1b5d33bf6494aaff261b401933f2 (patch)
tree7bf73a071b1e118d1f328aada8dfa40b858147cf /block
parent95a156f689269da57e42dd1b001ea86c0877ed86 (diff)
block/replication: drop extra synchronization
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 <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/replication.c24
1 files changed, 1 insertions, 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);
}