aio: Introduce aio_external_disabled

This allows AioContext users to check the enable/disable state of
external clients.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1446177989-6702-2-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Fam Zheng 2015-10-30 12:06:27 +08:00 committed by Stefan Hajnoczi
parent 8347c53243
commit 5ceb9e3928

View File

@ -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