Commit 5ceb9e39 authored by Fam Zheng's avatar Fam Zheng Committed by Stefan Hajnoczi
Browse files

aio: Introduce aio_external_disabled



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

Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Message-id: 1446177989-6702-2-git-send-email-famz@redhat.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 8347c532
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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