Issue time fixup for guasi/libaio
[fio.git] / engines / syslet-rw.c
index ab64054b9c5b7fd39c05067778878436f4db4bc5..2eab207cd8c7cb4c0ab175a321b3d9842fe72634 100644 (file)
@@ -14,8 +14,7 @@
 #include <asm/unistd.h>
 
 #include "../fio.h"
-#include "../indirect.h"
-#include "../syslet.h"
+#include "../lib/fls.h"
 
 #ifdef FIO_HAVE_SYSLET
 
@@ -223,7 +222,6 @@ static void fio_syslet_cleanup(struct thread_data *td)
                free(sd->events);
                free(sd->ring);
                free(sd);
-               td->io_ops->data = NULL;
        }
 }
 
@@ -243,14 +241,8 @@ static int fio_syslet_init(struct thread_data *td)
         * The ring needs to be a power-of-2, so round it up if we have to
         */
        ring_nr = td->o.iodepth;
-       if (ring_nr & (ring_nr - 1)) {
-               int bits = 1;
-
-               while (ring_nr >>= 1)
-                       bits++;
-
-               ring_nr = 1 << bits;
-       }
+       if (ring_nr & (ring_nr - 1))
+               ring_nr = 1 << __fls(ring_nr);
 
        ring_size = sizeof(struct syslet_ring) +
                        ring_nr * sizeof(struct syslet_completion);