All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] aio: add missing aio_notify() to aio_enable_external()
Date: Fri, 5 May 2017 18:19:55 +0800	[thread overview]
Message-ID: <20170505101955.GG21435@lemon.lan> (raw)
In-Reply-To: <20170505100255.11145-1-stefanha@redhat.com>

On Fri, 05/05 11:02, Stefan Hajnoczi wrote:
> diff --git a/include/block/aio.h b/include/block/aio.h
> index 406e323..b3d6f76 100644
> --- a/include/block/aio.h
> +++ b/include/block/aio.h
> @@ -454,8 +454,14 @@ static inline void aio_disable_external(AioContext *ctx)
>   */
>  static inline void aio_enable_external(AioContext *ctx)
>  {
> -    assert(ctx->external_disable_cnt > 0);
> -    atomic_dec(&ctx->external_disable_cnt);
> +    int old;
> +
> +    old = atomic_dec_fetch(&ctx->external_disable_cnt);

Did you mean atomic_fetch_dec? atomic_dec_fetch is new, not old.

> +    assert(old > 0);
> +    if (old == 1) {
> +        /* Kick event loop so it re-arms file descriptors */
> +        aio_notify(ctx);
> +    }
>  }
>  
>  /**
> -- 
> 2.9.3
> 

  reply	other threads:[~2017-05-05 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 10:02 [Qemu-devel] [PATCH v2] aio: add missing aio_notify() to aio_enable_external() Stefan Hajnoczi
2017-05-05 10:19 ` Fam Zheng [this message]
2017-05-08 16:49   ` Stefan Hajnoczi
2017-05-05 15:48 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170505101955.GG21435@lemon.lan \
    --to=famz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.