[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/53] block/backup: drop extra gotos from backup_run()
From: |
Max Reitz |
Subject: |
[PULL 42/53] block/backup: drop extra gotos from backup_run() |
Date: |
Tue, 26 Jan 2021 15:20:05 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210116214705.822267-17-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/backup.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/block/backup.c b/block/backup.c
index 5522c0f3fe..466608ee55 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -236,7 +236,7 @@ static void backup_init_bcs_bitmap(BackupBlockJob *job)
static int coroutine_fn backup_run(Job *job, Error **errp)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common.job);
- int ret = 0;
+ int ret;
backup_init_bcs_bitmap(s);
@@ -246,13 +246,12 @@ static int coroutine_fn backup_run(Job *job, Error **errp)
for (offset = 0; offset < s->len; ) {
if (yield_and_check(s)) {
- ret = -ECANCELED;
- goto out;
+ return -ECANCELED;
}
ret = block_copy_reset_unallocated(s->bcs, offset, &count);
if (ret < 0) {
- goto out;
+ return ret;
}
offset += count;
@@ -273,11 +272,10 @@ static int coroutine_fn backup_run(Job *job, Error **errp)
job_yield(job);
}
} else {
- ret = backup_loop(s);
+ return backup_loop(s);
}
- out:
- return ret;
+ return 0;
}
static const BlockJobDriver backup_job_driver = {
--
2.29.2
- [PULL 34/53] job: call job_enter from job_pause, (continued)
- [PULL 34/53] job: call job_enter from job_pause, Max Reitz, 2021/01/26
- [PULL 35/53] qapi: backup: add max-chunk and max-workers to x-perf struct, Max Reitz, 2021/01/26
- [PULL 33/53] blockjob: add set_speed to BlockJobDriver, Max Reitz, 2021/01/26
- [PULL 31/53] block/block-copy: add ratelimit to block-copy, Max Reitz, 2021/01/26
- [PULL 36/53] iotests: 56: prepare for backup over block-copy, Max Reitz, 2021/01/26
- [PULL 37/53] iotests/129: Limit backup's max-chunk/max-workers, Max Reitz, 2021/01/26
- [PULL 38/53] iotests: 185: prepare for backup over block-copy, Max Reitz, 2021/01/26
- [PULL 39/53] iotests: 219: prepare for backup over block-copy, Max Reitz, 2021/01/26
- [PULL 43/53] backup: move to block-copy, Max Reitz, 2021/01/26
- [PULL 40/53] iotests: 257: prepare for backup over block-copy, Max Reitz, 2021/01/26
- [PULL 42/53] block/backup: drop extra gotos from backup_run(),
Max Reitz <=
- [PULL 41/53] block/block-copy: make progress_bytes_callback optional, Max Reitz, 2021/01/26
- [PULL 45/53] block/block-copy: drop unused block_copy_set_progress_callback(), Max Reitz, 2021/01/26
- [PULL 47/53] simplebench/bench_block_job: use correct shebang line with python3, Max Reitz, 2021/01/26
- [PULL 44/53] qapi: backup: disable copy_range by default, Max Reitz, 2021/01/26
- [PULL 50/53] block: report errno when flock fcntl fails, Max Reitz, 2021/01/26
- [PULL 51/53] iotests: Add test for the regression fixed in c8bf9a9169, Max Reitz, 2021/01/26
- [PULL 46/53] block/block-copy: drop unused argument of block_copy(), Max Reitz, 2021/01/26
- [PULL 49/53] simplebench: add bench-backup.py, Max Reitz, 2021/01/26
- [PULL 48/53] simplebench: bench_block_job: add cmd_options argument, Max Reitz, 2021/01/26
- [PULL 52/53] iotests/118: Drop 'change' test, Max Reitz, 2021/01/26