projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Warning fixes
[fio.git]
/
engines
/
syslet-rw.c
diff --git
a/engines/syslet-rw.c
b/engines/syslet-rw.c
index e4ccb957194d29b9cd70b8624d51a8f591563a5e..2eab207cd8c7cb4c0ab175a321b3d9842fe72634 100644
(file)
--- a/
engines/syslet-rw.c
+++ b/
engines/syslet-rw.c
@@
-14,8
+14,7
@@
#include <asm/unistd.h>
#include "../fio.h"
#include <asm/unistd.h>
#include "../fio.h"
-#include "../indirect.h"
-#include "../syslet.h"
+#include "../lib/fls.h"
#ifdef FIO_HAVE_SYSLET
#ifdef FIO_HAVE_SYSLET
@@
-99,8
+98,8
@@
static void fio_syslet_wait_for_events(struct thread_data *td)
} while (1);
}
} while (1);
}
-static int fio_syslet_getevents(struct thread_data *td, int min,
- int fio_unused max,
+static int fio_syslet_getevents(struct thread_data *td,
unsigned
int min,
+
unsigned
int fio_unused max,
struct timespec fio_unused *t)
{
struct syslet_data *sd = td->io_ops->data;
struct timespec fio_unused *t)
{
struct syslet_data *sd = td->io_ops->data;
@@
-108,8
+107,10
@@
static int fio_syslet_getevents(struct thread_data *td, int min,
/*
* While we have less events than requested, block waiting for them
/*
* While we have less events than requested, block waiting for them
+ * (if we have to, there may already be more completed events ready
+ * for us - see fio_syslet_wait_for_events()
*/
*/
- while (sd->nr_events <
(unsigned int)
min)
+ while (sd->nr_events < min)
fio_syslet_wait_for_events(td);
ret = sd->nr_events;
fio_syslet_wait_for_events(td);
ret = sd->nr_events;
@@
-220,9
+221,7
@@
static void fio_syslet_cleanup(struct thread_data *td)
if (sd) {
free(sd->events);
free(sd->ring);
if (sd) {
free(sd->events);
free(sd->ring);
- free(sd->stack);
free(sd);
free(sd);
- td->io_ops->data = NULL;
}
}
}
}
@@
-242,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;
* 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);
ring_size = sizeof(struct syslet_ring) +
ring_nr * sizeof(struct syslet_completion);