[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] block: Factor out bdrv_run_co()
From: |
Eric Blake |
Subject: |
Re: [PATCH v2] block: Factor out bdrv_run_co() |
Date: |
Tue, 19 May 2020 13:28:17 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 5/19/20 12:56 PM, Vladimir Sementsov-Ogievskiy wrote:
We have a few bdrv_*() functions that can either spawn a new coroutine
and wait for it with BDRV_POLL_WHILE() or use a fastpath if they are
alreeady running in a coroutine. All of them duplicate basically the
already
same code.
Factor the common code into a new function bdrv_run_co().
Signed-off-by: Kevin Wolf <address@hidden>
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
[Factor out bdrv_run_co_entry too]
---
Hi!
I'm a bit lost on rebasing "block/io: safer inc/dec in_flight sections"
(is it needed or not?), so, I decided to send just this one patch:
I suggest to go a bit further, and refactor that bdrv_run_co don't need
additional *ret argument neither NOT_DONE logic.
Yes, and this approach was easier to review than v1.
block/io.c | 191 ++++++++++++++++++++---------------------------------
1 file changed, 70 insertions(+), 121 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org