From patchwork Wed Sep 7 16:28:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 1127912 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p87Gtvwf025873 for ; Wed, 7 Sep 2011 16:55:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338Ab1IGQz4 (ORCPT ); Wed, 7 Sep 2011 12:55:56 -0400 Received: from cobra.newdream.net ([66.33.216.30]:38875 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753276Ab1IGQzz (ORCPT ); Wed, 7 Sep 2011 12:55:55 -0400 Received: from vapre.ww.newdream.net (dsl092-035-022.lax1.dsl.speakeasy.net [66.92.35.22]) by cobra.newdream.net (Postfix) with ESMTPA id 578FBBC7F9; Wed, 7 Sep 2011 10:01:30 -0700 (PDT) From: Sage Weil To: qemu-devel@nongnu.org, kwolf@redhat.com Cc: ceph-devel@vger.kernel.org, Sage Weil Subject: [PATCH 2/3] rbd: clean up, fix style Date: Wed, 7 Sep 2011 09:28:05 -0700 Message-Id: <1315412886-21092-2-git-send-email-sage@newdream.net> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1315412886-21092-1-git-send-email-sage@newdream.net> References: <1315412886-21092-1-git-send-email-sage@newdream.net> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 07 Sep 2011 16:55:57 +0000 (UTC) No assignment in condition. Remove duplicate ret > 0 check. Signed-off-by: Sage Weil Reviewed-by: Stefan Hajnoczi --- block/rbd.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 6135fc1..2763092 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -391,15 +391,14 @@ static void qemu_rbd_aio_event_reader(void *opaque) char *p = (char *)&s->event_rcb; /* now read the rcb pointer that was sent from a non qemu thread */ - if ((ret = read(s->fds[RBD_FD_READ], p + s->event_reader_pos, - sizeof(s->event_rcb) - s->event_reader_pos)) > 0) { - if (ret > 0) { - s->event_reader_pos += ret; - if (s->event_reader_pos == sizeof(s->event_rcb)) { - s->event_reader_pos = 0; - qemu_rbd_complete_aio(s->event_rcb); - s->qemu_aio_count--; - } + ret = read(s->fds[RBD_FD_READ], p + s->event_reader_pos, + sizeof(s->event_rcb) - s->event_reader_pos); + if (ret > 0) { + s->event_reader_pos += ret; + if (s->event_reader_pos == sizeof(s->event_rcb)) { + s->event_reader_pos = 0; + qemu_rbd_complete_aio(s->event_rcb); + s->qemu_aio_count--; } } } while (ret < 0 && errno == EINTR);