[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 2/6] introduce BDRV_POLL_WHILE_UNLOCKED
From: |
Emanuele Giuseppe Esposito |
Subject: |
[RFC PATCH 2/6] introduce BDRV_POLL_WHILE_UNLOCKED |
Date: |
Mon, 13 Dec 2021 05:40:10 -0500 |
Same as BDRV_POLL_WHILE, but uses AIO_WAIT_WHILE_UNLOCKED.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
include/block/block-global-state.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/block/block-global-state.h
b/include/block/block-global-state.h
index 7a6b065101..818164a06b 100644
--- a/include/block/block-global-state.h
+++ b/include/block/block-global-state.h
@@ -158,6 +158,11 @@ void bdrv_drain_all(void);
AIO_WAIT_WHILE(bdrv_get_aio_context(bs_), \
cond); })
+#define BDRV_POLL_WHILE_UNLOCKED(bs, cond) ({ \
+ BlockDriverState *bs_ = (bs); \
+ AIO_WAIT_WHILE_UNLOCKED(bdrv_get_aio_context(bs_), \
+ cond); })
+
int bdrv_has_zero_init_1(BlockDriverState *bs);
int bdrv_has_zero_init(BlockDriverState *bs);
int bdrv_can_set_read_only(BlockDriverState *bs, bool read_only,
--
2.31.1
- [RFC PATCH 0/6] Removal of Aiocontext lock and usage of subtree drains in aborted transactions, Emanuele Giuseppe Esposito, 2021/12/13
- [RFC PATCH 2/6] introduce BDRV_POLL_WHILE_UNLOCKED,
Emanuele Giuseppe Esposito <=
- [RFC PATCH 3/6] block/io.c: introduce bdrv_subtree_drained_{begin/end}_unlocked, Emanuele Giuseppe Esposito, 2021/12/13
- [RFC PATCH 1/6] tests/unit/test-bdrv-drain.c: graph setup functions can't run in coroutines, Emanuele Giuseppe Esposito, 2021/12/13
- [RFC PATCH 5/6] test-bdrv-drain.c: adapt test to the new subtree drains, Emanuele Giuseppe Esposito, 2021/12/13
- [RFC PATCH 4/6] block.c: add subtree_drains where needed, Emanuele Giuseppe Esposito, 2021/12/13
- [RFC PATCH 6/6] block/io.c: enable assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2021/12/13
- Re: [RFC PATCH 0/6] Removal of Aiocontext lock and usage of subtree drains in aborted transactions, Stefan Hajnoczi, 2021/12/13
- Re: [RFC PATCH 0/6] Removal of Aiocontext lock and usage of subtree drains in aborted transactions, Stefan Hajnoczi, 2021/12/14