qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH v4 1/3] aio: Introduce aio_external_disabled


From: Fam Zheng
Subject: [Qemu-block] [PATCH v4 1/3] aio: Introduce aio_external_disabled
Date: Fri, 30 Oct 2015 12:06:27 +0800

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

Signed-off-by: Fam Zheng <address@hidden>
---
 include/block/aio.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/block/aio.h b/include/block/aio.h
index bcc7d43..dcf74be 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -401,6 +401,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.
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]