Move gtod_cpu affinity check to verify callback
authorJens Axboe <jens.axboe@oracle.com>
Wed, 1 Jul 2009 08:42:18 +0000 (10:42 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 1 Jul 2009 08:42:18 +0000 (10:42 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c
options.c

diff --git a/init.c b/init.c
index cd32725c4b9893ed2983419e44835f707b4a1935..d40009d2b75f6cf343e3f867c237e290a1eea8f0 100644 (file)
--- a/init.c
+++ b/init.c
@@ -233,22 +233,6 @@ static int fixup_options(struct thread_data *td)
        }
 #endif
 
-#ifndef FIO_HAVE_CPU_AFFINITY
-       if (td->o.gtod_cpu) {
-               log_err("fio: platform must support CPU affinity for"
-                       "gettimeofday() offloading\n");
-               return 1;
-       }
-#endif
-
-#if 0
-       if (read_only && td_write(td)) {
-               log_err("fio: job <%s> has write bit set, but fio is in"
-                       " read-only mode\n", td->o.name);
-               return 1;
-       }
-#endif
-
        if (o->write_iolog_file && o->read_iolog_file) {
                log_err("fio: read iolog overrides write_iolog\n");
                free(o->write_iolog_file);
index 354067d3deafba1fe8e0b946d0b72e7445f85ebc..8c0c2abd295c667ddc195f7acaa34f9aa7ce5f14 100644 (file)
--- a/options.c
+++ b/options.c
@@ -588,6 +588,21 @@ static int rw_verify(struct fio_option *o, void *data)
        return 0;
 }
 
+static int gtod_cpu_rw_verify(struct fio_option *o, void *data)
+{
+       struct thread_data *td = data;
+
+#ifndef FIO_HAVE_CPU_AFFINITY
+       if (td->o.gtod_cpu) {
+               log_err("fio: platform must support CPU affinity for"
+                       "gettimeofday() offloading\n");
+               return 1;
+       }
+#endif
+
+       return 0;
+}
+
 #define __stringify_1(x)       #x
 #define __stringify(x)         __stringify_1(x)
 
@@ -1534,6 +1549,7 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_INT,
                .cb     = str_gtod_cpu_cb,
                .help   = "Setup dedicated gettimeofday() thread on this CPU",
+               .verify = gtod_cpu_verify,
        },
        {
                .name   = "continue_on_error",