Commit d7eca542 authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Kevin Wolf
Browse files

block/block-copy: Simplify block_copy_do_copy()



block_copy_do_copy() is static, only used in block_copy_task_entry
with the error_is_read argument set. No need to check for it,
simplify.

Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200507121129.29760-3-philmd@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent c78dd00e
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -343,10 +343,8 @@ static int coroutine_fn block_copy_do_copy(BlockCopyState *s,
                                    ~BDRV_REQ_WRITE_COMPRESSED);
        if (ret < 0) {
            trace_block_copy_write_zeroes_fail(s, offset, ret);
            if (error_is_read) {
            *error_is_read = false;
        }
        }
        return ret;
    }

@@ -393,9 +391,7 @@ static int coroutine_fn block_copy_do_copy(BlockCopyState *s,
    ret = bdrv_co_pread(s->source, offset, nbytes, bounce_buffer, 0);
    if (ret < 0) {
        trace_block_copy_read_fail(s, offset, ret);
        if (error_is_read) {
        *error_is_read = true;
        }
        goto out;
    }

@@ -403,9 +399,7 @@ static int coroutine_fn block_copy_do_copy(BlockCopyState *s,
                         s->write_flags);
    if (ret < 0) {
        trace_block_copy_write_fail(s, offset, ret);
        if (error_is_read) {
        *error_is_read = false;
        }
        goto out;
    }