diff options
author | Sage Weil <sage@newdream.net> | 2011-09-07 09:28:05 -0700 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-09-12 15:17:21 +0200 |
commit | dfe80b071b6ef6c9c0b4e36191e2fe2d16050766 (patch) | |
tree | bc4f013df1fd86dab3c2c9b66ead67ee4e31c373 /block/rbd.c | |
parent | 7c7e9df0232a1ce5c411f0f348038d2e72097ae1 (diff) | |
download | qemu-dfe80b071b6ef6c9c0b4e36191e2fe2d16050766.tar.gz qemu-dfe80b071b6ef6c9c0b4e36191e2fe2d16050766.tar.bz2 qemu-dfe80b071b6ef6c9c0b4e36191e2fe2d16050766.zip |
rbd: clean up, fix style
No assignment in condition. Remove duplicate ret > 0 check.
Signed-off-by: Sage Weil <sage@newdream.net>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/rbd.c')
-rw-r--r-- | block/rbd.c | 17 |
1 files 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); |