diff mbox

[PULL,3/7] aio: Introduce aio_external_disabled

Message ID 1446832349-14952-4-git-send-email-stefanha@redhat.com
State New
Headers show

Commit Message

Stefan Hajnoczi Nov. 6, 2015, 5:52 p.m. UTC
From: Fam Zheng <famz@redhat.com>

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>
---
 include/block/aio.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/include/block/aio.h b/include/block/aio.h
index 92efc5e..cab7c76 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -406,6 +406,17 @@  static inline void aio_enable_external(AioContext *ctx)
 }
 
 /**
+ * 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
  * @is_external: Whether or not the checked node is an external event source.