[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 48/51] block/block-copy: Simplify block_copy_do_copy()
From: |
Kevin Wolf |
Subject: |
[PULL 48/51] block/block-copy: Simplify block_copy_do_copy() |
Date: |
Fri, 15 May 2020 14:45:18 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
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é <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
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
- [PULL 41/51] block: Use bdrv_default_perms(), (continued)
- [PULL 41/51] block: Use bdrv_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 43/51] block: Drop bdrv_format_default_perms(), Kevin Wolf, 2020/05/15
- [PULL 46/51] block: Drop @child_class from bdrv_child_perm(), Kevin Wolf, 2020/05/15
- [PULL 42/51] block: Make bdrv_filter_default_perms() static, Kevin Wolf, 2020/05/15
- [PULL 44/51] block: Drop child_file, Kevin Wolf, 2020/05/15
- [PULL 45/51] block: Pass BdrvChildRole in remaining cases, Kevin Wolf, 2020/05/15
- [PULL 47/51] block/block-copy: Fix uninitialized variable in block_copy_task_entry, Kevin Wolf, 2020/05/15
- [PULL 49/51] iotests: log messages from notrun(), Kevin Wolf, 2020/05/15
- [PULL 50/51] hw/ide/ahci: Log lost IRQs, Kevin Wolf, 2020/05/15
- [PULL 51/51] iotests/030: Reduce run time by unthrottling job earlier, Kevin Wolf, 2020/05/15
- [PULL 48/51] block/block-copy: Simplify block_copy_do_copy(),
Kevin Wolf <=
- Re: [PULL 00/51] Block layer patches, Peter Maydell, 2020/05/15
- Re: [PULL 00/51] Block layer patches, no-reply, 2020/05/15