From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy2FU-0006ZH-9H for qemu-devel@nongnu.org; Fri, 20 Jun 2014 13:05:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy2FJ-00072y-3U for qemu-devel@nongnu.org; Fri, 20 Jun 2014 13:05:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy2FI-00072r-Sg for qemu-devel@nongnu.org; Fri, 20 Jun 2014 13:05:01 -0400 Message-ID: <53A469B6.4040708@redhat.com> Date: Fri, 20 Jun 2014 19:04:54 +0200 From: Max Reitz MIME-Version: 1.0 References: <1403118403-14397-1-git-send-email-mreitz@redhat.com> <1403118403-14397-2-git-send-email-mreitz@redhat.com> <20140619035846.GD21236@stefanha-thinkpad.redhat.com> In-Reply-To: <20140619035846.GD21236@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi On 19.06.2014 05:58, Stefan Hajnoczi wrote: > 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. Thanks for spotting this, I'll drop it in v3. Max