[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/50] job.c: API functions not used outside should be static
From: |
Kevin Wolf |
Subject: |
[PULL 31/50] job.c: API functions not used outside should be static |
Date: |
Fri, 7 Oct 2022 12:47:33 +0200 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
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>
Message-Id: <20220926093214.506243-4-eesposit@redhat.com>
Signed-off-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 8530c6a4e1..e3e31e2548 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 7365db827a..9500b5b36e 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.37.3
- [PULL 02/50] coroutine: Drop coroutine_fn annotation from qemu_coroutine_self(), (continued)
- [PULL 02/50] coroutine: Drop coroutine_fn annotation from qemu_coroutine_self(), Kevin Wolf, 2022/10/07
- [PULL 04/50] block: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 08/50] blkverify: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 21/50] vmdk: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 06/50] nbd: remove incorrect coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 07/50] coroutine: remove incorrect coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 03/50] block/nvme: separate nvme_get_free_req cases for coroutine/non-coroutine context, Kevin Wolf, 2022/10/07
- [PULL 25/50] 9p: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 28/50] quorum: Remove unnecessary forward declaration, Kevin Wolf, 2022/10/07
- [PULL 23/50] coroutine-lock: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 31/50] job.c: API functions not used outside should be static,
Kevin Wolf <=
- [PULL 32/50] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED, Kevin Wolf, 2022/10/07
- [PULL 17/50] curl: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 11/50] nbd: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 15/50] qcow2: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 37/50] jobs: use job locks also in the unit tests, Kevin Wolf, 2022/10/07
- [PULL 33/50] job.c: add job_lock/unlock while keeping job.h intact, Kevin Wolf, 2022/10/07
- [PULL 48/50] blockjob: remove unused functions, Kevin Wolf, 2022/10/07
- [PULL 27/50] test-coroutine: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 13/50] nvme: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07
- [PULL 22/50] job: add missing coroutine_fn annotations, Kevin Wolf, 2022/10/07