Skip to content
Snippets Groups Projects
Commit dfe80b07 authored by Sage Weil's avatar Sage Weil Committed by Kevin Wolf
Browse files

rbd: clean up, fix style


No assignment in condition.  Remove duplicate ret > 0 check.

Signed-off-by: default avatarSage Weil <sage@newdream.net>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 7c7e9df0
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment