Re: [PATCH v5 20/20] block_job_query: remove atomic read

2022-03-08 Thread Stefan Hajnoczi
On Tue, Feb 08, 2022 at 09:35:13AM -0500, Emanuele Giuseppe Esposito wrote:
> 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.
> 
> Signed-off-by: Emanuele Giuseppe Esposito 
> ---
>  blockjob.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi 


signature.asc
Description: PGP signature


[PATCH v5 20/20] block_job_query: remove atomic read

2022-02-08 Thread Emanuele Giuseppe Esposito
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.

Signed-off-by: Emanuele Giuseppe Esposito 
---
 blockjob.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blockjob.c b/blockjob.c
index afb0e9ad5e..e7ed4f545d 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -329,7 +329,7 @@ BlockJobInfo *block_job_query_locked(BlockJob *job, Error 
**errp)
 info = g_new0(BlockJobInfo, 1);
 info->type  = g_strdup(job_type_str(>job));
 info->device= g_strdup(job->job.id);
-info->busy  = qatomic_read(>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