[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 03/19] job.c: make job_event_* functions static
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v4 03/19] job.c: make job_event_* functions static |
Date: |
Fri, 28 Jan 2022 06:50:15 -0500 |
job_event_* functions can all be static, as they are not used
outside job.c.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@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 a36ef921c9..6f22a20d58 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -438,12 +438,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 f5e5b04e8c..e97b159396 100644
--- a/job.c
+++ b/job.c
@@ -427,12 +427,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.31.1
- [PATCH v4 00/19] job: replace AioContext lock with job_mutex, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 01/19] job.c: make job_mutex and job_lock/unlock() public, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 02/19] job.h: categorize fields in struct Job, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 03/19] job.c: make job_event_* functions static,
Emanuele Giuseppe Esposito <=
- [PATCH v4 05/19] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 08/19] jobs: add job lock in find_* functions, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 12/19] job.h: define unlocked functions, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 04/19] job.c: move inner aiocontext lock in callbacks, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 13/19] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 17/19] jobs: protect job.aio_context with BQL and job_mutex, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 16/19] job: detect change of aiocontext within job coroutine, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 14/19] blockjob: block_job_get_aio_context is a GS function, Emanuele Giuseppe Esposito, 2022/01/28
- [PATCH v4 11/19] jobs: document all static functions and add _locked() suffix, Emanuele Giuseppe Esposito, 2022/01/28