From dfe80b071b6ef6c9c0b4e36191e2fe2d16050766 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Sep 2011 09:28:05 -0700 Subject: rbd: clean up, fix style No assignment in condition. Remove duplicate ret > 0 check. Signed-off-by: Sage Weil Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/rbd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 6135fc17cd..276309293a 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); -- cgit v1.2.3