From dc5bfbb227f1af83adf0b686d147b7ae2107c144 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 10 Apr 2013 22:23:40 +0200 Subject: [PATCH] Merge in crc32c-intel probe Then we can kill the option callback. Signed-off-by: Jens Axboe --- backend.c | 2 ++ options.c | 13 ------------- verify.c | 8 ++++++++ verify.h | 1 + 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/backend.c b/backend.c index fcb74dcb..c397eb17 100644 --- a/backend.c +++ b/backend.c @@ -1256,6 +1256,8 @@ static void *thread_main(void *data) goto err; } + fio_verify_init(td); + fio_gettime(&td->epoch, NULL); fio_getrusage(&td->ru_start); clear_state = 0; diff --git a/options.c b/options.c index e30aacc9..16b9fbc0 100644 --- a/options.c +++ b/options.c @@ -348,18 +348,6 @@ static int str_mem_cb(void *data, const char *mem) return 0; } -static int str_verify_cb(void *data, const char *mem) -{ - struct thread_data *td = data; - - if (td->o.verify == VERIFY_CRC32C_INTEL || - td->o.verify == VERIFY_CRC32C) { - crc32c_intel_probe(); - } - - return 0; -} - static int fio_clock_source_cb(void *data, const char *str) { struct thread_data *td = data; @@ -2091,7 +2079,6 @@ static struct fio_option fio_options[FIO_MAX_OPTS] = { .type = FIO_OPT_STR, .off1 = td_var_offset(verify), .help = "Verify data written", - .cb = str_verify_cb, .def = "0", .category = FIO_OPT_C_IO, .group = FIO_OPT_G_VERIFY, diff --git a/verify.c b/verify.c index daa2f04a..787cc377 100644 --- a/verify.c +++ b/verify.c @@ -1006,6 +1006,14 @@ int get_next_verify(struct thread_data *td, struct io_u *io_u) return 1; } +void fio_verify_init(struct thread_data *td) +{ + if (td->o.verify == VERIFY_CRC32C_INTEL || + td->o.verify == VERIFY_CRC32C) { + crc32c_intel_probe(); + } +} + static void *verify_async_thread(void *data) { struct thread_data *td = data; diff --git a/verify.h b/verify.h index 7c238c8d..6a81e9b0 100644 --- a/verify.h +++ b/verify.h @@ -75,6 +75,7 @@ extern int __must_check get_next_verify(struct thread_data *td, struct io_u *); extern int __must_check verify_io_u(struct thread_data *, struct io_u *); extern int verify_io_u_async(struct thread_data *, struct io_u *); extern void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u *io_u, unsigned long seed, int use_seed); +extern void fio_verify_init(struct thread_data *td); /* * Async verify offload -- 2.25.1