Merge branch 'master' of ssh://router/data/git/fio
authorJens Axboe <axboe@nelson.home.kernel.dk>
Fri, 3 Nov 2006 13:00:49 +0000 (14:00 +0100)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Fri, 3 Nov 2006 13:00:49 +0000 (14:00 +0100)
engines/fio-engine-libaio.c
engines/fio-engine-posixaio.c
engines/fio-engine-sg.c
engines/fio-engine-splice.c
fio.h
init.c

index 1848dcc4398164d3c9c241377709e538b7c97435..c0f280b51ed447e1d125f2ee4c2806ffbd10c87b 100644 (file)
@@ -10,6 +10,8 @@
 #include "fio.h"
 #include "os.h"
 
+#ifdef FIO_HAVE_LIBAIO
+
 #define ev_to_iou(ev)  (struct io_u *) ((unsigned long) (ev)->obj)
 
 struct libaio_data {
@@ -138,3 +140,24 @@ struct ioengine_ops ioengine = {
        .event          = fio_libaio_event,
        .cleanup        = fio_libaio_cleanup,
 };
+
+#else /* FIO_HAVE_LIBAIO */
+
+/*
+ * 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_libaio_init(struct thread_data fio_unused *td)
+{
+       fprintf(stderr, "fio: libaio not available\n");
+       return 1;
+}
+
+struct ioengine_ops ioengine = {
+       .name           = "libaio",
+       .version        = FIO_IOOPS_VERSION,
+       .init           = fio_libaio_init,
+};
+
+#endif
index 2d0fd3114b6469729997721643f8d66e3826451f..401cd866ba549ee193098f3af54998c6e6aef2fd 100644 (file)
@@ -10,6 +10,8 @@
 #include "fio.h"
 #include "os.h"
 
+#ifdef FIO_HAVE_POSIXAIO
+
 struct posixaio_data {
        struct io_u **aio_events;
 };
@@ -186,3 +188,24 @@ struct ioengine_ops ioengine = {
        .event          = fio_posixaio_event,
        .cleanup        = fio_posixaio_cleanup,
 };
+
+#else /* FIO_HAVE_POSIXAIO */
+
+/*
+ * 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_posixaio_init(struct thread_data fio_unused *td)
+{
+       fprintf(stderr, "fio: posixaio not available\n");
+       return 1;
+}
+
+struct ioengine_ops ioengine = {
+       .name           = "posixaio",
+       .version        = FIO_IOOPS_VERSION,
+       .init           = fio_posixaio_init,
+};
+
+#endif
index 112f027869a840aebe43bc2f16c5e0a9a75873f5..fafc326968df8019f7485880732d13cbc7484b84 100644 (file)
@@ -11,6 +11,8 @@
 #include "fio.h"
 #include "os.h"
 
+#ifdef FIO_HAVE_SGIO
+
 struct sgio_cmd {
        unsigned char cdb[10];
        int nr;
@@ -314,3 +316,24 @@ struct ioengine_ops ioengine = {
        .cleanup        = fio_sgio_cleanup,
        .flags          = FIO_SYNCIO | FIO_RAWIO,
 };
+
+#else /* FIO_HAVE_SGIO */
+
+/*
+ * 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_sgio_init(struct thread_data fio_unused *td)
+{
+       fprintf(stderr, "fio: sgio not available\n");
+       return 1;
+}
+
+struct ioengine_ops ioengine = {
+       .name           = "sgio",
+       .version        = FIO_IOOPS_VERSION,
+       .init           = fio_sgio_init,
+};
+
+#endif
index 192fbd00bffdf14184a249e481dbfc95ab4e7f07..3b02fbfdbb83c45906810e0126f1d2d65cc74cb0 100644 (file)
@@ -11,6 +11,8 @@
 #include "fio.h"
 #include "os.h"
 
+#ifdef FIO_HAVE_SPLICE
+
 struct spliceio_data {
        struct io_u *last_io_u;
        int pipe[2];
@@ -189,3 +191,24 @@ struct ioengine_ops ioengine = {
        .cleanup        = fio_spliceio_cleanup,
        .flags          = FIO_SYNCIO,
 };
+
+#else /* FIO_HAVE_SPLICE */
+
+/*
+ * 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_spliceio_init(struct thread_data fio_unused *td)
+{
+       fprintf(stderr, "fio: splice not available\n");
+       return 1;
+}
+
+struct ioengine_ops ioengine = {
+       .name           = "splice",
+       .version        = FIO_IOOPS_VERSION,
+       .init           = fio_spliceio_init,
+};
+
+#endif
diff --git a/fio.h b/fio.h
index 5bb5569584cc289d49bb9afd9831ba05bd98d0ee..b94bf4313081bfed79fbed4ff8b67274a134ad83 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <string.h>
 
 #include "list.h"
 #include "md5.h"
diff --git a/init.c b/init.c
index 689c495b6ac648059a513c325d92620b7bd82beb..3c27ea55aa09107a9a62595aa658c86ce11871c5 100644 (file)
--- a/init.c
+++ b/init.c
@@ -60,8 +60,10 @@ static int str_ioengine_cb(void *, const char *);
 static int str_mem_cb(void *, const char *);
 static int str_verify_cb(void *, const char *);
 static int str_lockmem_cb(void *, unsigned long *);
+#ifdef FIO_HAVE_IOPRIO
 static int str_prio_cb(void *, unsigned int *);
 static int str_prioclass_cb(void *, unsigned int *);
+#endif
 static int str_exitall_cb(void);
 static int str_cpumask_cb(void *, unsigned int *);
 
@@ -543,19 +545,6 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
        int numjobs, ddir, i;
        struct fio_file *f;
 
-#ifndef FIO_HAVE_LIBAIO
-       if (td->io_engine == FIO_LIBAIO) {
-               log_err("Linux libaio not available\n");
-               return 1;
-       }
-#endif
-#ifndef FIO_HAVE_POSIXAIO
-       if (td->io_engine == FIO_POSIXAIO) {
-               log_err("posix aio not available\n");
-               return 1;
-       }
-#endif
-
        /*
         * the def_thread is just for options, it's not a real job
         */
@@ -857,6 +846,7 @@ static int str_lockmem_cb(void fio_unused *data, unsigned long *val)
        return 0;
 }
 
+#ifdef FIO_HAVE_IOPRIO
 static int str_prioclass_cb(void *data, unsigned int *val)
 {
        struct thread_data *td = data;
@@ -872,6 +862,7 @@ static int str_prio_cb(void *data, unsigned int *val)
        td->ioprio |= *val;
        return 0;
 }
+#endif
 
 static int str_exitall_cb(void)
 {