[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 22/26] coroutine-lock: add missing coroutine_fn annotations
From: |
Paolo Bonzini |
Subject: |
[PATCH 22/26] coroutine-lock: add missing coroutine_fn annotations |
Date: |
Thu, 22 Sep 2022 10:49:20 +0200 |
Callers of coroutine_fn must be coroutine_fn themselves, or the call
must be within "if (qemu_in_coroutine())". Apply coroutine_fn to
functions where this holds.
Reviewed-by: Alberto Faria <afaria@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
util/qemu-coroutine-lock.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
index 9ad24ab1af..15c82d9348 100644
--- a/util/qemu-coroutine-lock.c
+++ b/util/qemu-coroutine-lock.c
@@ -135,7 +135,7 @@ typedef struct CoWaitRecord {
QSLIST_ENTRY(CoWaitRecord) next;
} CoWaitRecord;
-static void push_waiter(CoMutex *mutex, CoWaitRecord *w)
+static void coroutine_fn push_waiter(CoMutex *mutex, CoWaitRecord *w)
{
w->co = qemu_coroutine_self();
QSLIST_INSERT_HEAD_ATOMIC(&mutex->from_push, w, next);
@@ -332,7 +332,7 @@ void qemu_co_rwlock_init(CoRwlock *lock)
}
/* Releases the internal CoMutex. */
-static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock)
+static void coroutine_fn qemu_co_rwlock_maybe_wake_one(CoRwlock *lock)
{
CoRwTicket *tkt = QSIMPLEQ_FIRST(&lock->tickets);
Coroutine *co = NULL;
@@ -365,7 +365,7 @@ static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock)
}
}
-void qemu_co_rwlock_rdlock(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_rdlock(CoRwlock *lock)
{
Coroutine *self = qemu_coroutine_self();
@@ -390,7 +390,7 @@ void qemu_co_rwlock_rdlock(CoRwlock *lock)
self->locks_held++;
}
-void qemu_co_rwlock_unlock(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_unlock(CoRwlock *lock)
{
Coroutine *self = qemu_coroutine_self();
@@ -408,7 +408,7 @@ void qemu_co_rwlock_unlock(CoRwlock *lock)
qemu_co_rwlock_maybe_wake_one(lock);
}
-void qemu_co_rwlock_downgrade(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_downgrade(CoRwlock *lock)
{
qemu_co_mutex_lock(&lock->mutex);
assert(lock->owners == -1);
@@ -418,7 +418,7 @@ void qemu_co_rwlock_downgrade(CoRwlock *lock)
qemu_co_rwlock_maybe_wake_one(lock);
}
-void qemu_co_rwlock_wrlock(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_wrlock(CoRwlock *lock)
{
Coroutine *self = qemu_coroutine_self();
@@ -438,7 +438,7 @@ void qemu_co_rwlock_wrlock(CoRwlock *lock)
self->locks_held++;
}
-void qemu_co_rwlock_upgrade(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_upgrade(CoRwlock *lock)
{
qemu_co_mutex_lock(&lock->mutex);
assert(lock->owners > 0);
--
2.37.3
- [PATCH 15/26] copy-before-write: add missing coroutine_fn annotations, (continued)
- [PATCH 15/26] copy-before-write: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 23/26] raw-format: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 14/26] qcow2: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 17/26] qed: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 16/26] curl: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 20/26] vmdk: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 13/26] parallels: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 19/26] throttle: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 21/26] job: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 25/26] migration: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 22/26] coroutine-lock: add missing coroutine_fn annotations,
Paolo Bonzini <=
- [PATCH 12/26] nvme: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 26/26] test-coroutine: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 04/26] nbd: remove incorrect coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 18/26] quorum: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 24/26] 9p: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22