fsync(td->fd);
}
+static int io_u_getevents(struct thread_data *td, int min, int max,
+ struct timespec *t)
+{
+ int r;
+
+ do {
+ r = io_getevents(td->aio_ctx, min, max, td->aio_events, t);
+ if (r != -EAGAIN && r != -EINTR)
+ break;
+ } while (1);
+
+ return r;
+}
+
static int io_u_queue(struct thread_data *td, struct io_u *io_u)
{
struct iocb *iocb = &io_u->iocb;
/*
* get immediately available events, if any
*/
- r = io_getevents(td->aio_ctx, 0, td->cur_depth, td->aio_events, &ts);
+ r = io_u_getevents(td, 0, td->cur_depth, &ts);
if (r > 0)
ios_completed(td, r);
}
if (td->cur_depth) {
- r = io_getevents(td->aio_ctx, td->cur_depth, td->cur_depth, td->aio_events, NULL);
+ r = io_u_getevents(td, td->cur_depth, td->cur_depth, NULL);
if (r > 0)
ios_completed(td, r);
}
if (async_do_verify(td, &v_io_u))
break;
- ret = io_getevents(td->aio_ctx, 1, 1, td->aio_events, NULL);
+ ret = io_u_getevents(td, 1, 1, NULL);
if (ret != 1) {
if (ret < 0)
td->error = ret;
min_evts = 1;
}
- ret = io_getevents(td->aio_ctx, min_evts, td->cur_depth, td->aio_events, timeout);
+ ret = io_u_getevents(td, min_evts, td->cur_depth, timeout);
if (ret < 0) {
td->error = errno;
break;