OSDN Git Service

block: Factor out bdrv_run_co()
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 20 May 2020 14:49:01 +0000 (17:49 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 5 Jun 2020 08:54:48 +0000 (09:54 +0100)
commit7d2410cea154bf915fb30179ebda3b17ac36e70e
treec305b58c3a342dfdfcf86d3c103b0fb0c24a9767
parentab7e41e6679224e5ad8da6d70ed7e645a5a482ab
block: Factor out bdrv_run_co()

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
same code.

Factor the common code into a new function bdrv_run_co().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20200520144901.16589-1-vsementsov@virtuozzo.com
   [Factor out bdrv_run_co_entry too]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/io.c