mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
7c7e9df023
commit
dfe80b071b
|
@ -391,8 +391,8 @@ static void qemu_rbd_aio_event_reader(void *opaque)
|
||||||
char *p = (char *)&s->event_rcb;
|
char *p = (char *)&s->event_rcb;
|
||||||
|
|
||||||
/* now read the rcb pointer that was sent from a non qemu thread */
|
/* 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,
|
ret = read(s->fds[RBD_FD_READ], p + s->event_reader_pos,
|
||||||
sizeof(s->event_rcb) - s->event_reader_pos)) > 0) {
|
sizeof(s->event_rcb) - s->event_reader_pos);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
s->event_reader_pos += ret;
|
s->event_reader_pos += ret;
|
||||||
if (s->event_reader_pos == sizeof(s->event_rcb)) {
|
if (s->event_reader_pos == sizeof(s->event_rcb)) {
|
||||||
|
@ -401,7 +401,6 @@ static void qemu_rbd_aio_event_reader(void *opaque)
|
||||||
s->qemu_aio_count--;
|
s->qemu_aio_count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} while (ret < 0 && errno == EINTR);
|
} while (ret < 0 && errno == EINTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue