[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 09/10] aio_context: create aio_context_is_owner hel
From: |
Denis V. Lunev |
Subject: |
[Qemu-stable] [PATCH 09/10] aio_context: create aio_context_is_owner helper |
Date: |
Tue, 3 Nov 2015 17:12:12 +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..1d18d98 100644
--- a/async.c
+++ b/async.c
@@ -361,3 +361,8 @@ void aio_context_release(AioContext *ctx)
{
rfifolock_unlock(&ctx->lock);
}
+
+bool aio_context_is_owner(AioContext *ctx)
+{
+ return rfifolock_is_owner(&ctx->lock);
+}
diff --git a/include/block/aio.h b/include/block/aio.h
index bcc7d43..d8cd41a 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 owned by the current thread. */
+bool aio_context_is_owner(AioContext *ctx);
+
/**
* aio_bh_new: Allocate a new bottom half structure.
*
--
2.5.0
- [Qemu-stable] [PATCH 01/10] migration: add missed aio_context_acquire for state writing/reading, (continued)
- [Qemu-stable] [PATCH 01/10] migration: add missed aio_context_acquire for state writing/reading, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 02/10] block: add missed aio_context_acquire around bdrv_set_aio_context, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 03/10] migration: added missed aio_context_acquire around bdrv_snapshot_delete, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 05/10] block: guard bdrv_drain in bdrv_close with aio_context_acquire, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 04/10] blockdev: acquire AioContext in hmp_commit(), Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 07/10] block: call aio_context_acquire in qemu_img/nbd/io, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 08/10] fifolock: create rfifolock_is_owner helper, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 06/10] io: guard aio_poll with aio_context_acquire, Denis V. Lunev, 2015/11/03
- [Qemu-stable] [PATCH 09/10] aio_context: create aio_context_is_owner helper,
Denis V. Lunev <=
- [Qemu-stable] [PATCH 10/10] aio: change aio_poll constraints, Denis V. Lunev, 2015/11/03