+ }
+
+ /*
+ * Move later completions to the front, if we didn't complete all
+ */
+ if (end == (int) sd->event_map_idx - 1)
+ sd->event_map_idx = 0;
+ else {
+ int nr = sd->event_map_idx - end - 1;
+
+ memmove(sd->event_map, &sd->event_map[end + 1], nr * sizeof(struct syslet_uatom *));
+ sd->event_map_idx = nr;
+ }
+}
+
+/*
+ * Inspect the ring to see if we have completed events
+ */
+static void fio_syslet_complete(struct thread_data *td)
+{
+ struct syslet_data *sd = td->io_ops->data;
+
+ do {
+ struct syslet_uatom *atom;
+
+ atom = sd->ring[sd->ahu.user_ring_idx];
+ if (!atom)
+ break;
+
+ sd->ring[sd->ahu.user_ring_idx] = NULL;
+ if (++sd->ahu.user_ring_idx == td->iodepth)
+ sd->ahu.user_ring_idx = 0;
+
+ fio_syslet_complete_atom(td, atom);