From 29d43ff9b1f342fe6658b17f0e349afcb6b76014 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 1 Jul 2009 10:42:18 +0200 Subject: [PATCH] Move gtod_cpu affinity check to verify callback Signed-off-by: Jens Axboe --- init.c | 16 ---------------- options.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/init.c b/init.c index cd32725c..d40009d2 100644 --- 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); diff --git a/options.c b/options.c index 354067d3..8c0c2abd 100644 --- 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", -- 2.25.1