Merge in crc32c-intel probe
authorJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2013 20:23:40 +0000 (22:23 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Apr 2013 20:23:40 +0000 (22:23 +0200)
Then we can kill the option callback.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
options.c
verify.c
verify.h

index fcb74dcbcfc3d39b7916c3c1f2f8fcb43127e889..c397eb173d2f6ad19552ab683af6517b48567e4a 100644 (file)
--- 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;
index e30aacc939d7e0fb0ecb001e91b07a4ab093dd87..16b9fbc09c9f25d68dbc1aca568bfc949d908085 100644 (file)
--- 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,
index daa2f04a7419146dbf98b74b68fcf432860a0abe..787cc377d2fbf33699721d5310b6b50f939a70c5 100644 (file)
--- 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;
index 7c238c8d2de6c07f19497061e12a4c60ba6b06c3..6a81e9b012bc6fa0632a90ea0dc2e9acfe26755f 100644 (file)
--- 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