[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 2/5] aio_context: create aio_context_is_locked help
From: |
Denis V. Lunev |
Subject: |
[Qemu-stable] [PATCH 2/5] aio_context: create aio_context_is_locked helper |
Date: |
Tue, 27 Oct 2015 17:09:43 +0300 |
This helper is necessary to ensure locking constraints.
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
CC: Paolo Bonzini <address@hidden>
---
async.c | 5 +++++
include/block/aio.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/async.c b/async.c
index bdc64a3..4a9250e 100644
--- a/async.c
+++ b/async.c
@@ -361,3 +361,8 @@ void aio_context_release(AioContext *ctx)
{
rfifolock_unlock(&ctx->lock);
}
+
+int aio_context_is_locked(AioContext *ctx)
+{
+ return rfifolock_is_locked(&ctx->lock);
+}
diff --git a/include/block/aio.h b/include/block/aio.h
index bcc7d43..d20c7b8 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -166,6 +166,9 @@ void aio_context_acquire(AioContext *ctx);
/* Relinquish ownership of the AioContext. */
void aio_context_release(AioContext *ctx);
+/* Check that AioContext is locked by the caller. */
+int aio_context_is_locked(AioContext *ctx);
+
/**
* aio_bh_new: Allocate a new bottom half structure.
*
--
2.1.4
- [Qemu-stable] [PATCH v2 0/5] dataplane snapshot fixes, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 3/5] io: add locking constraints check into bdrv_drain to ensure locking, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 1/5] fifolock: create rfifolock_is_locked helper, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 2/5] aio_context: create aio_context_is_locked helper,
Denis V. Lunev <=
- [Qemu-stable] [PATCH 5/5] virtio: sync the dataplane vring state to the virtqueue before virtio_save, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 4/5] migration: add missed aio_context_acquire into hmp_savevm/hmp_delvm, Denis V. Lunev, 2015/10/27
- Re: [Qemu-stable] [PATCH v2 0/5] dataplane snapshot fixes, Paolo Bonzini, 2015/10/27