From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxTVA-00082w-MM for qemu-devel@nongnu.org; Wed, 18 Jun 2014 23:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxTV1-0004rK-MI for qemu-devel@nongnu.org; Wed, 18 Jun 2014 23:59:04 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:49081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxTV1-0004rE-F9 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 23:58:55 -0400 Received: by mail-wi0-f179.google.com with SMTP id cc10so2136476wib.0 for ; Wed, 18 Jun 2014 20:58:54 -0700 (PDT) Date: Thu, 19 Jun 2014 11:58:46 +0800 From: Stefan Hajnoczi Message-ID: <20140619035846.GD21236@stefanha-thinkpad.redhat.com> References: <1403118403-14397-1-git-send-email-mreitz@redhat.com> <1403118403-14397-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2iBwrppp/7QCDedR" Content-Disposition: inline In-Reply-To: <1403118403-14397-2-git-send-email-mreitz@redhat.com> 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: Max Reitz Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi --2iBwrppp/7QCDedR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --2iBwrppp/7QCDedR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTol/2AAoJEJykq7OBq3PIFzsIALTxp/BqRdwfoBS4Z99PYI4z hiVH1XCCnUsvQLgPna3jS+Qa7eHItQqKwoHWBzxl/ISMxZrCCIfg8kMT5A+fNYi6 lp40kkJ8JsrGr1gnx8ManTU0ZIzTZweMbLKtP1ebVQE/ukC2cZDQJig/qeaXROIb Xj0cCizJJ0KGgo4zlXBy8kYk5+/J9SltJGOOsUbcKb906e9nwzbYpRfO+hFvyKMu /d86nf7GabPE4nAJXm62YVo9yePH80KqgcOAJ7LSEnfpeK8kohWT6Hx9HZQ84PLu P/AkJAmvxPivuoO6R2MPfFsgAQ1L7Q3T35YX73EW7FxtgsIfW0Wy0SabaSJ32DQ= =x7m9 -----END PGP SIGNATURE----- --2iBwrppp/7QCDedR--