[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 06/14] job.c: make job_event_* functions static
From: |
Emanuele Giuseppe Esposito |
Subject: |
[RFC PATCH v2 06/14] job.c: make job_event_* functions static |
Date: |
Thu, 4 Nov 2021 10:53:26 -0400 |
job_event_* functions can all be static, as they are not used
outside job.c.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
include/qemu/job.h | 6 ------
job.c | 12 ++++++++++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/qemu/job.h b/include/qemu/job.h
index d34c55dad0..58b3af47e3 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -425,12 +425,6 @@ void job_progress_set_remaining(Job *job, uint64_t
remaining);
*/
void job_progress_increase_remaining(Job *job, uint64_t delta);
-/** To be called when a cancelled job is finalised. */
-void job_event_cancelled(Job *job);
-
-/** To be called when a successfully completed job is finalised. */
-void job_event_completed(Job *job);
-
/**
* Conditionally enter the job coroutine if the job is ready to run, not
* already busy and fn() returns true. fn() is called while under the job_lock
diff --git a/job.c b/job.c
index bd36207021..ce5066522f 100644
--- a/job.c
+++ b/job.c
@@ -514,12 +514,20 @@ void job_progress_increase_remaining(Job *job, uint64_t
delta)
progress_increase_remaining(&job->progress, delta);
}
-void job_event_cancelled(Job *job)
+/**
+ * To be called when a cancelled job is finalised.
+ * Called with job_mutex held.
+ */
+static void job_event_cancelled(Job *job)
{
notifier_list_notify(&job->on_finalize_cancelled, job);
}
-void job_event_completed(Job *job)
+/**
+ * To be called when a successfully completed job is finalised.
+ * Called with job_mutex held.
+ */
+static void job_event_completed(Job *job)
{
notifier_list_notify(&job->on_finalize_completed, job);
}
--
2.27.0
- [RFC PATCH v2 00/14] job: replace AioContext lock with job_mutex, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 03/14] job.h: define locked functions, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 02/14] job.h: categorize fields in struct Job, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 01/14] job.c: make job_lock/unlock public, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 04/14] job.h: define unlocked functions, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 05/14] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 06/14] job.c: make job_event_* functions static,
Emanuele Giuseppe Esposito <=
- [RFC PATCH v2 09/14] jobs: remove aiocontext locks since the functions are under BQL, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 08/14] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 07/14] job.c: move inner aiocontext lock in callbacks, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 11/14] block_job_query: remove atomic read, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 12/14] jobs: use job locks and helpers also in the unit tests, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 14/14] job.c: enable job lock/unlock and remove Aiocontext locks, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 10/14] jobs: protect jobs with job_lock/unlock, Emanuele Giuseppe Esposito, 2021/11/04
- [RFC PATCH v2 13/14] jobs: add job lock in find_* functions, Emanuele Giuseppe Esposito, 2021/11/04