From: Fam Zheng Date: Fri, 30 Oct 2015 04:06:27 +0000 (+0800) Subject: aio: Introduce aio_external_disabled X-Git-Tag: v2.5.0-rc0~22^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ceb9e39284b69d2e1b01da3cb1894ad4b2b4606;p=thirdparty%2Fqemu.git aio: Introduce aio_external_disabled This allows AioContext users to check the enable/disable state of external clients. Signed-off-by: Fam Zheng Message-id: 1446177989-6702-2-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi --- diff --git a/include/block/aio.h b/include/block/aio.h index 92efc5e1f1c..cab7c765e3d 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -405,6 +405,17 @@ static inline void aio_enable_external(AioContext *ctx) atomic_dec(&ctx->external_disable_cnt); } +/** + * aio_external_disabled: + * @ctx: the aio context + * + * Return true if the external clients are disabled. + */ +static inline bool aio_external_disabled(AioContext *ctx) +{ + return atomic_read(&ctx->external_disable_cnt); +} + /** * aio_node_check: * @ctx: the aio context