All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 48/51] block/block-copy: Simplify block_copy_do_copy()
Date: Fri, 15 May 2020 14:45:18 +0200	[thread overview]
Message-ID: <20200515124521.335403-49-kwolf@redhat.com> (raw)
In-Reply-To: <20200515124521.335403-1-kwolf@redhat.com>

From: Philippe Mathieu-Daudé <philmd@redhat.com>

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é <philmd@redhat.com>
Message-Id: <20200507121129.29760-3-philmd@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/block-copy.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/block/block-copy.c b/block/block-copy.c
index 7c7f7acbae..bb8d0569f2 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -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;
     }
 
-- 
2.25.4



  parent reply	other threads:[~2020-05-15 13:17 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 12:44 [PULL 00/51] Block layer patches Kevin Wolf
2020-05-15 12:44 ` [PULL 01/51] iotests/109: Don't mirror with mismatched size Kevin Wolf
2020-05-15 12:44 ` [PULL 02/51] iotests/229: Use blkdebug to inject an error Kevin Wolf
2020-05-15 12:44 ` [PULL 03/51] mirror: Make sure that source and target size match Kevin Wolf
2020-05-15 12:44 ` [PULL 04/51] iotests: Mirror with different source/target size Kevin Wolf
2020-05-15 12:44 ` [PULL 05/51] block/replication.c: Avoid cancelling the job twice Kevin Wolf
2020-05-15 12:44 ` [PULL 06/51] iotests: Fix incomplete type declarations Kevin Wolf
2020-05-15 12:44 ` [PULL 07/51] iotests: Run pylint and mypy in a testcase Kevin Wolf
2020-05-15 12:44 ` [PULL 08/51] block: Add bdrv_make_empty() Kevin Wolf
2020-05-15 12:44 ` [PULL 09/51] block: Add blk_make_empty() Kevin Wolf
2020-05-15 12:44 ` [PULL 10/51] block: Use blk_make_empty() after commits Kevin Wolf
2020-05-15 12:44 ` [PULL 11/51] replication: Avoid blk_make_empty() on read-only child Kevin Wolf
2020-05-15 12:44 ` [PULL 12/51] block: Use bdrv_make_empty() where possible Kevin Wolf
2020-05-15 12:44 ` [PULL 13/51] block: Mark commit, mirror, blkreplay as filters Kevin Wolf
2020-05-15 12:44 ` [PULL 14/51] block: Add BlockDriver.is_format Kevin Wolf
2020-05-15 12:44 ` [PULL 15/51] block: Rename BdrvChildRole to BdrvChildClass Kevin Wolf
2020-05-15 12:44 ` [PULL 16/51] block: Add BdrvChildRole and BdrvChildRoleBits Kevin Wolf
2020-05-15 12:44 ` [PULL 17/51] block: Add BdrvChildRole to BdrvChild Kevin Wolf
2020-05-15 12:44 ` [PULL 18/51] block: Pass BdrvChildRole to bdrv_child_perm() Kevin Wolf
2020-05-15 12:44 ` [PULL 19/51] block: Pass BdrvChildRole to .inherit_options() Kevin Wolf
2020-05-15 12:44 ` [PULL 20/51] block: Pass parent_is_format " Kevin Wolf
2020-05-15 12:44 ` [PULL 21/51] block: Rename bdrv_inherited_options() Kevin Wolf
2020-05-15 12:44 ` [PULL 22/51] block: Add generic bdrv_inherited_options() Kevin Wolf
2020-05-15 12:44 ` [PULL 23/51] block: Use bdrv_inherited_options() Kevin Wolf
2020-05-15 12:44 ` [PULL 24/51] block: Unify bdrv_child_cb_attach() Kevin Wolf
2020-05-15 12:44 ` [PULL 25/51] block: Unify bdrv_child_cb_detach() Kevin Wolf
2020-05-15 12:44 ` [PULL 26/51] block: Add child_of_bds Kevin Wolf
2020-05-15 12:44 ` [PULL 27/51] block: Distinguish paths in *_format_default_perms Kevin Wolf
2020-05-15 12:44 ` [PULL 28/51] block: Pull out bdrv_default_perms_for_cow() Kevin Wolf
2020-05-15 12:44 ` [PULL 29/51] block: Pull out bdrv_default_perms_for_storage() Kevin Wolf
2020-05-15 12:45 ` [PULL 30/51] block: Relax *perms_for_storage for data children Kevin Wolf
2020-05-15 12:45 ` [PULL 31/51] block: Add bdrv_default_perms() Kevin Wolf
2020-05-15 12:45 ` [PULL 32/51] raw-format: Split raw_read_options() Kevin Wolf
2020-05-15 12:45 ` [PULL 33/51] block: Switch child_format users to child_of_bds Kevin Wolf
2020-05-15 12:45 ` [PULL 34/51] block: Drop child_format Kevin Wolf
2020-05-15 12:45 ` [PULL 35/51] block: Make backing files child_of_bds children Kevin Wolf
2020-05-15 12:45 ` [PULL 36/51] block: Drop child_backing Kevin Wolf
2020-05-15 12:45 ` [PULL 37/51] block: Make format drivers use child_of_bds Kevin Wolf
2020-05-15 12:45 ` [PULL 38/51] block: Make filter " Kevin Wolf
2020-05-15 12:45 ` [PULL 39/51] block: Use child_of_bds in remaining places Kevin Wolf
2020-05-15 12:45 ` [PULL 40/51] tests: Use child_of_bds instead of child_file Kevin Wolf
2020-05-15 12:45 ` [PULL 41/51] block: Use bdrv_default_perms() Kevin Wolf
2020-05-15 12:45 ` [PULL 42/51] block: Make bdrv_filter_default_perms() static Kevin Wolf
2020-05-15 12:45 ` [PULL 43/51] block: Drop bdrv_format_default_perms() Kevin Wolf
2020-05-15 12:45 ` [PULL 44/51] block: Drop child_file Kevin Wolf
2020-05-15 12:45 ` [PULL 45/51] block: Pass BdrvChildRole in remaining cases Kevin Wolf
2020-05-15 12:45 ` [PULL 46/51] block: Drop @child_class from bdrv_child_perm() Kevin Wolf
2020-05-15 12:45 ` [PULL 47/51] block/block-copy: Fix uninitialized variable in block_copy_task_entry Kevin Wolf
2020-05-15 12:45 ` Kevin Wolf [this message]
2020-05-15 12:45 ` [PULL 49/51] iotests: log messages from notrun() Kevin Wolf
2020-05-15 12:45 ` [PULL 50/51] hw/ide/ahci: Log lost IRQs Kevin Wolf
2020-05-15 12:45 ` [PULL 51/51] iotests/030: Reduce run time by unthrottling job earlier Kevin Wolf
2020-05-15 14:28 ` [PULL 00/51] Block layer patches Peter Maydell
2020-05-15 20:30 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200515124521.335403-49-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.