]> Git Repo - qemu.git/commitdiff
block/block-copy: Simplify block_copy_do_copy()
authorPhilippe Mathieu-Daudé <[email protected]>
Thu, 7 May 2020 12:11:29 +0000 (14:11 +0200)
committerKevin Wolf <[email protected]>
Mon, 18 May 2020 17:05:25 +0000 (19:05 +0200)
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: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200507121129[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/block-copy.c

index 7c7f7acbae37e3fb1a4b02eab28d52cf88990b7d..bb8d0569f2bd1a5258d98457748dbc157a671b77 100644 (file)
@@ -343,9 +343,7 @@ 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;
-            }
+            *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;
-        }
+        *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;
-        }
+        *error_is_read = false;
         goto out;
     }
 
This page took 0.021869 seconds and 4 git commands to generate.