diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/backup.c | 19 | ||||
-rw-r--r-- | block/commit.c | 1 | ||||
-rw-r--r-- | block/mirror.c | 28 | ||||
-rw-r--r-- | block/stream.c | 1 |
4 files changed, 4 insertions, 45 deletions
diff --git a/block/backup.c b/block/backup.c index 03637aeb11..763f0d7ff6 100644 --- a/block/backup.c +++ b/block/backup.c @@ -425,21 +425,6 @@ void backup_do_checkpoint(BlockJob *job, Error **errp) bdrv_set_dirty_bitmap(backup_job->copy_bitmap, 0, backup_job->len); } -static void backup_drain(BlockJob *job) -{ - BackupBlockJob *s = container_of(job, BackupBlockJob, common); - - /* Need to keep a reference in case blk_drain triggers execution - * of backup_complete... - */ - if (s->target) { - BlockBackend *target = s->target; - blk_ref(target); - blk_drain(target); - blk_unref(target); - } -} - static BlockErrorAction backup_error_action(BackupBlockJob *job, bool read, int error) { @@ -588,13 +573,11 @@ static const BlockJobDriver backup_job_driver = { .job_type = JOB_TYPE_BACKUP, .free = block_job_free, .user_resume = block_job_user_resume, - .drain = block_job_drain, .run = backup_run, .commit = backup_commit, .abort = backup_abort, .clean = backup_clean, - }, - .drain = backup_drain, + } }; static int64_t backup_calculate_cluster_size(BlockDriverState *target, diff --git a/block/commit.c b/block/commit.c index 408ae15389..bc8454463d 100644 --- a/block/commit.c +++ b/block/commit.c @@ -216,7 +216,6 @@ static const BlockJobDriver commit_job_driver = { .job_type = JOB_TYPE_COMMIT, .free = block_job_free, .user_resume = block_job_user_resume, - .drain = block_job_drain, .run = commit_run, .prepare = commit_prepare, .abort = commit_abort, diff --git a/block/mirror.c b/block/mirror.c index 853e2c7510..fe984efb90 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -646,14 +646,11 @@ static int mirror_exit_common(Job *job) bdrv_ref(mirror_top_bs); bdrv_ref(target_bs); - /* Remove target parent that still uses BLK_PERM_WRITE/RESIZE before + /* + * Remove target parent that still uses BLK_PERM_WRITE/RESIZE before * inserting target_bs at s->to_replace, where we might not be able to get * these permissions. - * - * Note that blk_unref() alone doesn't necessarily drop permissions because - * we might be running nested inside mirror_drain(), which takes an extra - * reference, so use an explicit blk_set_perm() first. */ - blk_set_perm(s->target, 0, BLK_PERM_ALL, &error_abort); + */ blk_unref(s->target); s->target = NULL; @@ -1149,28 +1146,12 @@ static bool mirror_drained_poll(BlockJob *job) return !!s->in_flight; } -static void mirror_drain(BlockJob *job) -{ - MirrorBlockJob *s = container_of(job, MirrorBlockJob, common); - - /* Need to keep a reference in case blk_drain triggers execution - * of mirror_complete... - */ - if (s->target) { - BlockBackend *target = s->target; - blk_ref(target); - blk_drain(target); - blk_unref(target); - } -} - static const BlockJobDriver mirror_job_driver = { .job_driver = { .instance_size = sizeof(MirrorBlockJob), .job_type = JOB_TYPE_MIRROR, .free = block_job_free, .user_resume = block_job_user_resume, - .drain = block_job_drain, .run = mirror_run, .prepare = mirror_prepare, .abort = mirror_abort, @@ -1178,7 +1159,6 @@ static const BlockJobDriver mirror_job_driver = { .complete = mirror_complete, }, .drained_poll = mirror_drained_poll, - .drain = mirror_drain, }; static const BlockJobDriver commit_active_job_driver = { @@ -1187,7 +1167,6 @@ static const BlockJobDriver commit_active_job_driver = { .job_type = JOB_TYPE_COMMIT, .free = block_job_free, .user_resume = block_job_user_resume, - .drain = block_job_drain, .run = mirror_run, .prepare = mirror_prepare, .abort = mirror_abort, @@ -1195,7 +1174,6 @@ static const BlockJobDriver commit_active_job_driver = { .complete = mirror_complete, }, .drained_poll = mirror_drained_poll, - .drain = mirror_drain, }; static void coroutine_fn diff --git a/block/stream.c b/block/stream.c index 0d3a6ac7c3..5562ccbf57 100644 --- a/block/stream.c +++ b/block/stream.c @@ -212,7 +212,6 @@ static const BlockJobDriver stream_job_driver = { .abort = stream_abort, .clean = stream_clean, .user_resume = block_job_user_resume, - .drain = block_job_drain, }, }; |