OSDN Git Service

block-coroutine-wrapper: Introduce no_co_wrapper
authorKevin Wolf <kwolf@redhat.com>
Thu, 26 Jan 2023 17:24:20 +0000 (18:24 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 17 Feb 2023 10:22:19 +0000 (11:22 +0100)
commitd6ee2e324ec26a02776d90125e3a55454f0ca57e
tree05a2db277d24d721903a5474c308160a59b8f2c1
parent1e84cf79573e364075d6e63a4b00f7dc5f8aa924
block-coroutine-wrapper: Introduce no_co_wrapper

Some functions must not be called from coroutine context. The common
pattern to use them anyway from a coroutine is running them in a BH and
letting the calling coroutine yield to be woken up when the BH is
completed.

Instead of manually writing such wrappers, add support for generating
them to block-coroutine-wrapper.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230126172432.436111-2-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/block/block-common.h
scripts/block-coroutine-wrapper.py