qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 10/13] block/mirror: condense cancellation an


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 10/13] block/mirror: condense cancellation and relax calls
Date: Wed, 7 Feb 2018 23:36:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 2018-01-19 21:58, John Snow wrote:
> We can count on the relax call to check cancellation for us, so
> condense these concurrent calls.
> 
> Signed-off-by: John Snow <address@hidden>
> ---
>  block/mirror.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/block/mirror.c b/block/mirror.c
> index 3c73caed5e..a0e0044de2 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -610,9 +610,7 @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob 
> *s)
>              int bytes = MIN(s->bdev_length - offset,
>                              QEMU_ALIGN_DOWN(INT_MAX, s->granularity));
>  
> -            block_job_relax(&s->common, 0);
> -
> -            if (block_job_is_cancelled(&s->common)) {
> +            if (block_job_relax(&s->common, 0)) {
>                  s->initial_zeroing_ongoing = false;
>                  return 0;
>              }
> @@ -638,9 +636,7 @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob 
> *s)
>          int bytes = MIN(s->bdev_length - offset,
>                          QEMU_ALIGN_DOWN(INT_MAX, s->granularity));
>  
> -        block_job_relax(&s->common, 0);
> -
> -        if (block_job_is_cancelled(&s->common)) {
> +        if (block_job_relax(&s->common, 0)) {
>              return 0;
>          }

“See <a href="HEAD^">last patch</a>.”

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]