[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/9] block/io: move flush and pdiscard stuff down
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 3/9] block/io: move flush and pdiscard stuff down |
Date: |
Mon, 27 Apr 2020 17:39:01 +0300 |
bdrv_co_flush and bdrv_co_pdiscard will become static in further patch,
move their usage down.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block/io.c | 56 +++++++++++++++++++++++++++---------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/block/io.c b/block/io.c
index 880871e691..1134f8144a 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2827,20 +2827,6 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb)
/**************************************************************/
/* Coroutine block device emulation */
-typedef struct FlushCo {
- BlockDriverState *bs;
- int ret;
-} FlushCo;
-
-
-static void coroutine_fn bdrv_flush_co_entry(void *opaque)
-{
- FlushCo *rwco = opaque;
-
- rwco->ret = bdrv_co_flush(rwco->bs);
- aio_wait_kick();
-}
-
int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
{
int current_gen;
@@ -2953,6 +2939,19 @@ early_exit:
return ret;
}
+typedef struct FlushCo {
+ BlockDriverState *bs;
+ int ret;
+} FlushCo;
+
+static void coroutine_fn bdrv_flush_co_entry(void *opaque)
+{
+ FlushCo *rwco = opaque;
+
+ rwco->ret = bdrv_co_flush(rwco->bs);
+ aio_wait_kick();
+}
+
int bdrv_flush(BlockDriverState *bs)
{
Coroutine *co;
@@ -2973,20 +2972,6 @@ int bdrv_flush(BlockDriverState *bs)
return flush_co.ret;
}
-typedef struct DiscardCo {
- BdrvChild *child;
- int64_t offset;
- int64_t bytes;
- int ret;
-} DiscardCo;
-static void coroutine_fn bdrv_pdiscard_co_entry(void *opaque)
-{
- DiscardCo *rwco = opaque;
-
- rwco->ret = bdrv_co_pdiscard(rwco->child, rwco->offset, rwco->bytes);
- aio_wait_kick();
-}
-
int coroutine_fn bdrv_co_pdiscard(BdrvChild *child, int64_t offset,
int64_t bytes)
{
@@ -3101,6 +3086,21 @@ out:
return ret;
}
+typedef struct DiscardCo {
+ BdrvChild *child;
+ int64_t offset;
+ int64_t bytes;
+ int ret;
+} DiscardCo;
+
+static void coroutine_fn bdrv_pdiscard_co_entry(void *opaque)
+{
+ DiscardCo *rwco = opaque;
+
+ rwco->ret = bdrv_co_pdiscard(rwco->child, rwco->offset, rwco->bytes);
+ aio_wait_kick();
+}
+
int bdrv_pdiscard(BdrvChild *child, int64_t offset, int64_t bytes)
{
Coroutine *co;
--
2.21.0
- [PATCH v2 0/9] block/io: safer inc/dec in_flight sections, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 1/9] block/io: refactor bdrv_is_allocated_above to run only one coroutine, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 8/9] block/io: move bdrv_make_zero under block-status, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 3/9] block/io: move flush and pdiscard stuff down,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 6/9] block/io: expand in_flight inc/dec section: block-status, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 4/9] block/io: move bdrv_rw_co_entry and friends down, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 5/9] block/io: expand in_flight inc/dec section: simple cases, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 9/9] block/io: expand in_flight inc/dec section: bdrv_make_zero, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 2/9] block/io: refactor bdrv_co_ioctl: move aio stuff to corresponding block, Vladimir Sementsov-Ogievskiy, 2020/04/27
- [PATCH v2 7/9] block/io: add bdrv_do_pwrite_zeroes, Vladimir Sementsov-Ogievskiy, 2020/04/27