[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 18/18] block_job_query: remove atomic read
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v6 18/18] block_job_query: remove atomic read |
Date: |
Mon, 14 Mar 2022 09:37:07 -0400 |
Not sure what the atomic here was supposed to do, since job.busy
is protected by the job lock. Since the whole function
is called under job_mutex, just remove the atomic.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
blockjob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blockjob.c b/blockjob.c
index 8b9e10813d..d84ddca363 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -324,7 +324,7 @@ BlockJobInfo *block_job_query_locked(BlockJob *job, Error
**errp)
info = g_new0(BlockJobInfo, 1);
info->type = g_strdup(job_type_str(&job->job));
info->device = g_strdup(job->job.id);
- info->busy = qatomic_read(&job->job.busy);
+ info->busy = job->job.busy;
info->paused = job->job.pause_count > 0;
info->offset = progress_current;
info->len = progress_total;
--
2.31.1
- [PATCH v6 03/18] job.c: API functions not used outside should be static, (continued)
- [PATCH v6 03/18] job.c: API functions not used outside should be static, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 04/18] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 01/18] job.c: make job_mutex and job_lock/unlock() public, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 02/18] job.h: categorize fields in struct Job, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 07/18] jobs: add job lock in find_* functions, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 12/18] block_job: rename block_job functions called with job_mutex held, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 15/18] job: detect change of aiocontext within job coroutine, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 10/18] jobs: rename static functions called with job_mutex held, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 08/18] jobs: use job locks also in the unit tests, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 05/18] job.h: add _locked duplicates for job API functions called with and without job_mutex, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 18/18] block_job_query: remove atomic read,
Emanuele Giuseppe Esposito <=
- [PATCH v6 17/18] job.c: enable job lock/unlock and remove Aiocontext locks, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 06/18] jobs: protect jobs with job_lock/unlock, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 11/18] job.h: rename job API functions called with job_mutex held, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 13/18] job.h: define unlocked functions, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 09/18] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 14/18] commit and mirror: create new nodes using bdrv_get_aio_context, and not the job aiocontext, Emanuele Giuseppe Esposito, 2022/03/14
- [PATCH v6 16/18] jobs: protect job.aio_context with BQL and job_mutex, Emanuele Giuseppe Esposito, 2022/03/14