diff mbox

[v5,02/12] nbd: Mark fd handlers client type as "external"

Message ID 1445393209-26545-3-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Oct. 21, 2015, 2:06 a.m. UTC
So we could distinguish it from internal used fds, thus avoid handling
unwanted events in nested aio polls.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 nbd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeff Cody Oct. 21, 2015, 3:21 p.m. UTC | #1
On Wed, Oct 21, 2015 at 10:06:39AM +0800, Fam Zheng wrote:
> So we could distinguish it from internal used fds, thus avoid handling
> unwanted events in nested aio polls.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  nbd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/nbd.c b/nbd.c
> index fbc66be..dab1ebb 100644
> --- a/nbd.c
> +++ b/nbd.c
> @@ -1446,7 +1446,7 @@ static void nbd_set_handlers(NBDClient *client)
>  {
>      if (client->exp && client->exp->ctx) {
>          aio_set_fd_handler(client->exp->ctx, client->sock,
> -                           false,
> +                           true,
>                             client->can_read ? nbd_read : NULL,
>                             client->send_coroutine ? nbd_restart_write : NULL,
>                             client);
> @@ -1457,7 +1457,7 @@ static void nbd_unset_handlers(NBDClient *client)
>  {
>      if (client->exp && client->exp->ctx) {
>          aio_set_fd_handler(client->exp->ctx, client->sock,
> -                           false, NULL, NULL, NULL);
> +                           true, NULL, NULL, NULL);
>      }
>  }
>  
> -- 
> 2.4.3
> 
> 

Reviewed-by: Jeff Cody <jcody@redhat.com>
diff mbox

Patch

diff --git a/nbd.c b/nbd.c
index fbc66be..dab1ebb 100644
--- a/nbd.c
+++ b/nbd.c
@@ -1446,7 +1446,7 @@  static void nbd_set_handlers(NBDClient *client)
 {
     if (client->exp && client->exp->ctx) {
         aio_set_fd_handler(client->exp->ctx, client->sock,
-                           false,
+                           true,
                            client->can_read ? nbd_read : NULL,
                            client->send_coroutine ? nbd_restart_write : NULL,
                            client);
@@ -1457,7 +1457,7 @@  static void nbd_unset_handlers(NBDClient *client)
 {
     if (client->exp && client->exp->ctx) {
         aio_set_fd_handler(client->exp->ctx, client->sock,
-                           false, NULL, NULL, NULL);
+                           true, NULL, NULL, NULL);
     }
 }