[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v11 03/21] job.c: API functions not used outside should be static
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v11 03/21] job.c: API functions not used outside should be static |
Date: |
Fri, 26 Aug 2022 09:20:46 -0400 |
job_event_* functions can all be static, as they are not used
outside job.c.
Same applies for job_txn_add_job().
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
include/qemu/job.h | 18 ------------------
job.c | 22 +++++++++++++++++++---
2 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/include/qemu/job.h b/include/qemu/job.h
index 876e13d549..4b64eb15f7 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -358,18 +358,6 @@ JobTxn *job_txn_new(void);
*/
void job_txn_unref(JobTxn *txn);
-/**
- * @txn: The transaction (may be NULL)
- * @job: Job to add to the transaction
- *
- * Add @job to the transaction. The @job must not already be in a transaction.
- * The caller must call either job_txn_unref() or job_completed() to release
- * the reference that is automatically grabbed here.
- *
- * If @txn is NULL, the function does nothing.
- */
-void job_txn_add_job(JobTxn *txn, Job *job);
-
/**
* Create a new long-running job and return it.
*
@@ -431,12 +419,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 2b4ffca9d4..cafd597ba4 100644
--- a/job.c
+++ b/job.c
@@ -125,7 +125,17 @@ void job_txn_unref(JobTxn *txn)
}
}
-void job_txn_add_job(JobTxn *txn, Job *job)
+/**
+ * @txn: The transaction (may be NULL)
+ * @job: Job to add to the transaction
+ *
+ * Add @job to the transaction. The @job must not already be in a transaction.
+ * The caller must call either job_txn_unref() or job_completed() to release
+ * the reference that is automatically grabbed here.
+ *
+ * If @txn is NULL, the function does nothing.
+ */
+static void job_txn_add_job(JobTxn *txn, Job *job)
{
if (!txn) {
return;
@@ -427,12 +437,18 @@ 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.
+ */
+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.
+ */
+static void job_event_completed(Job *job)
{
notifier_list_notify(&job->on_finalize_completed, job);
}
--
2.31.1
- [PATCH v11 00/21] job: replace AioContext lock with job_mutex, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 01/21] job.c: make job_mutex and job_lock/unlock() public, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 02/21] job.h: categorize fields in struct Job, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 03/21] job.c: API functions not used outside should be static,
Emanuele Giuseppe Esposito <=
- [PATCH v11 08/21] jobs: add job lock in find_* functions, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 07/21] blockjob: introduce block_job _locked() APIs, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 04/21] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 10/21] block/mirror.c: use of job helpers in drivers, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 14/21] blockjob.h: categorize fields in struct BlockJob, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 05/21] job.c: add job_lock/unlock while keeping job.h intact, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 15/21] blockjob: rename notifier callbacks as _locked, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 13/21] jobs: protect job.aio_context with BQL and job_mutex, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 11/21] jobs: group together API calls under the same job lock, Emanuele Giuseppe Esposito, 2022/08/26
- [PATCH v11 16/21] blockjob: protect iostatus field in BlockJob struct, Emanuele Giuseppe Esposito, 2022/08/26