+
+ /*
+ * Stop waiting when we have enough, but continue checking
+ * all pending IOs if they are complete.
+ */
+ if (*events >= min_evts)
+ continue;
+
+ rbd_io_u_wait_complete(io_u);
+
+ if (fri_check_complete(rbd, io_u, events))
+ this_events++;
+ }
+
+ return this_events;
+}
+
+static int fio_rbd_getevents(struct thread_data *td, unsigned int min,
+ unsigned int max, const struct timespec *t)
+{
+ unsigned int this_events, events = 0;
+ struct rbd_options *o = td->eo;
+ int wait = 0;
+
+ do {
+ this_events = rbd_iter_events(td, &events, min, wait);
+
+ if (events >= min)