qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()
Date: Thu, 19 Jun 2014 11:58:46 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Jun 18, 2014 at 09:06:41PM +0200, Max Reitz wrote:
> +static void nbd_update_can_read(NBDClient *client)
> +{
> +    bool can_read = client->recv_coroutine ||
> +                    client->nb_requests < MAX_NBD_REQUESTS;
> +
> +    if (can_read != client->can_read) {
> +        client->can_read = can_read;
> +        nbd_set_handlers(client);
> +
> +        /* If we got here, nb_requests had to be MAX_NBD_REQUESTS before */
> +        if (client->nb_requests < MAX_NBD_REQUESTS) {
> +            aio_notify(client->exp->ctx);
> +        }

nbd_set_handlers() indirectly invokes aio_notify(client->exp->ctx) via
aio_set_fd_handler().  This if statement is redundant.

Attachment: pgp1f3osC5Uy6.pgp
Description: PGP signature


reply via email to

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