fix: io_uring sqpoll issue_time empty when kernel not yet read sq
[fio.git] / engines / solarisaio.c
index 069cda5347c903d9f458772508b2f6eed0d2fc39..b2b47fede675c8cef09e4b921297d3e4a6bed27f 100644 (file)
@@ -10,8 +10,6 @@
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_SOLARISAIO
-
 #include <sys/asynch.h>
 
 struct solarisaio_data {
@@ -30,7 +28,7 @@ static int fio_solarisaio_cancel(struct thread_data fio_unused *td,
 static int fio_solarisaio_prep(struct thread_data fio_unused *td,
                            struct io_u *io_u)
 {
-       struct solarisaio_data *sd = td->io_ops->data;
+       struct solarisaio_data *sd = td->io_ops_data;
 
        io_u->resultp.aio_return = AIO_INPROGRESS;
        io_u->engine_data = sd;
@@ -75,9 +73,9 @@ static void wait_for_event(struct timeval *tv)
 }
 
 static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
-                                   unsigned int max, struct timespec *t)
+                                   unsigned int max, const struct timespec *t)
 {
-       struct solarisaio_data *sd = td->io_ops->data;
+       struct solarisaio_data *sd = td->io_ops_data;
        struct timeval tv;
        int ret;
 
@@ -102,15 +100,15 @@ static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
 
 static struct io_u *fio_solarisaio_event(struct thread_data *td, int event)
 {
-       struct solarisaio_data *sd = td->io_ops->data;
+       struct solarisaio_data *sd = td->io_ops_data;
 
        return sd->aio_events[event];
 }
 
-static int fio_solarisaio_queue(struct thread_data fio_unused *td,
+static enum fio_q_status fio_solarisaio_queue(struct thread_data fio_unused *td,
                              struct io_u *io_u)
 {
-       struct solarisaio_data *sd = td->io_ops->data;
+       struct solarisaio_data *sd = td->io_ops_data;
        struct fio_file *f = io_u->file;
        off_t off;
        int ret;
@@ -157,7 +155,7 @@ static int fio_solarisaio_queue(struct thread_data fio_unused *td,
 
 static void fio_solarisaio_cleanup(struct thread_data *td)
 {
-       struct solarisaio_data *sd = td->io_ops->data;
+       struct solarisaio_data *sd = td->io_ops_data;
 
        if (sd) {
                free(sd->aio_events);
@@ -187,8 +185,9 @@ static void fio_solarisaio_init_sigio(void)
 
 static int fio_solarisaio_init(struct thread_data *td)
 {
-       struct solarisaio_data *sd = malloc(sizeof(*sd));
        unsigned int max_depth;
+       struct solarisaio_data *sd;
+       sd = calloc(1, sizeof(*sd));
 
        max_depth = td->o.iodepth;
        if (max_depth > MAXASYNCHIO) {
@@ -197,16 +196,14 @@ static int fio_solarisaio_init(struct thread_data *td)
                                                        max_depth);
        }
 
-       memset(sd, 0, sizeof(*sd));
-       sd->aio_events = malloc(max_depth * sizeof(struct io_u *));
-       memset(sd->aio_events, 0, max_depth * sizeof(struct io_u *));
+       sd->aio_events = calloc(max_depth, sizeof(struct io_u *));
        sd->max_depth = max_depth;
 
 #ifdef USE_SIGNAL_COMPLETIONS
        fio_solarisaio_init_sigio();
 #endif
 
-       td->io_ops->data = sd;
+       td->io_ops_data = sd;
        return 0;
 }
 
@@ -225,27 +222,6 @@ static struct ioengine_ops ioengine = {
        .get_file_size  = generic_get_file_size,
 };
 
-#else /* FIO_HAVE_SOLARISAIO */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_solarisaio_init(struct thread_data fio_unused *td)
-{
-       fprintf(stderr, "fio: solarisaio not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "solarisaio",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_solarisaio_init,
-};
-
-#endif
-
 static void fio_init fio_solarisaio_register(void)
 {
        register_ioengine(&ioengine);