[PATCH] Make fio build again on "crippled" platforms
[fio.git] / init.c
diff --git a/init.c b/init.c
index 616c51f27ff738e7d2d2bd3eddbf7c924d693c3b..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 *);
 
@@ -138,17 +140,17 @@ static struct fio_option options[] = {
        },
        {
                .name   = "bs",
-               .type   = FIO_OPT_STR_VAL,
+               .type   = FIO_OPT_STR_VAL_INT,
                .off1   = td_var_offset(bs[DDIR_READ]),
        },
        {
                .name   = "read_bs",
-               .type   = FIO_OPT_STR_VAL,
+               .type   = FIO_OPT_STR_VAL_INT,
                .off1   = td_var_offset(bs[DDIR_READ]),
        },
        {
                .name   = "write_bs",
-               .type   = FIO_OPT_STR_VAL,
+               .type   = FIO_OPT_STR_VAL_INT,
                .off1   = td_var_offset(bs[DDIR_WRITE]),
        },
        {
@@ -513,9 +515,9 @@ static void fixup_options(struct thread_data *td)
        if (!td->max_bs[DDIR_READ])
                td->max_bs[DDIR_READ] = td->bs[DDIR_READ];
        if (!td->min_bs[DDIR_WRITE])
-               td->min_bs[DDIR_WRITE]= td->bs[DDIR_READ];
+               td->min_bs[DDIR_WRITE]= td->bs[DDIR_WRITE];
        if (!td->max_bs[DDIR_WRITE])
-               td->max_bs[DDIR_WRITE] = td->bs[DDIR_READ];
+               td->max_bs[DDIR_WRITE] = td->bs[DDIR_WRITE];
 
        td->rw_min_bs = min(td->min_bs[DDIR_READ], td->min_bs[DDIR_WRITE]);
 
@@ -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)
 {