options: make the groups/categories constant
[fio.git] / engines / sync.c
index 17714588030401e3b55b481be7ed9690e979cbd2..f5801fec9a9fd7a471e18d90fbb048d7a9fd03ec 100644 (file)
@@ -63,8 +63,10 @@ static int fio_io_end(struct thread_data *td, struct io_u *io_u, int ret)
                        io_u->error = errno;
        }
 
-       if (io_u->error)
+       if (io_u->error) {
+               io_u_log_error(td, io_u);
                td_verror(td, io_u->error, "xfer");
+       }
 
        return FIO_Q_COMPLETED;
 }
@@ -138,7 +140,7 @@ static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u)
 
 static int fio_vsyncio_getevents(struct thread_data *td, unsigned int min,
                                 unsigned int max,
-                                struct timespec fio_unused *t)
+                                const struct timespec fio_unused *t)
 {
        struct syncio_data *sd = td->io_ops->data;
        int ret;
@@ -315,9 +317,11 @@ static void fio_vsyncio_cleanup(struct thread_data *td)
 {
        struct syncio_data *sd = td->io_ops->data;
 
-       free(sd->iovecs);
-       free(sd->io_us);
-       free(sd);
+       if (sd) {
+               free(sd->iovecs);
+               free(sd->io_us);
+               free(sd);
+       }
 }
 
 static struct ioengine_ops ioengine_rw = {
@@ -375,7 +379,9 @@ static void fio_init fio_syncio_register(void)
        register_ioengine(&ioengine_rw);
        register_ioengine(&ioengine_prw);
        register_ioengine(&ioengine_vrw);
+#ifdef CONFIG_PWRITEV
        register_ioengine(&ioengine_pvrw);
+#endif
 }
 
 static void fio_exit fio_syncio_unregister(void)
@@ -383,5 +389,7 @@ static void fio_exit fio_syncio_unregister(void)
        unregister_ioengine(&ioengine_rw);
        unregister_ioengine(&ioengine_prw);
        unregister_ioengine(&ioengine_vrw);
+#ifdef CONFIG_PWRITEV
        unregister_ioengine(&ioengine_pvrw);
+#endif
 }