Add support for randomness of any IO direction
[fio.git] / options.c
index 1c44f426dcbde350f6bff5479e31aeee37b7702f..3da376e042aedd333bd8e7605c55b3795ae1d392 100644 (file)
--- a/options.c
+++ b/options.c
@@ -377,23 +377,6 @@ static int str_rwmix_write_cb(void *data, unsigned long long *val)
        return 0;
 }
 
-static int str_perc_rand_cb(void *data, unsigned long long *val)
-{
-       struct thread_data *td = data;
-
-       td->o.perc_rand = *val;
-       return 0;
-}
-
-static int str_perc_seq_cb(void *data, unsigned long long *val)
-{
-       struct thread_data *td = data;
-
-       td->o.perc_rand = 100 - *val;
-       return 0;
-}
-
-
 static int str_exitall_cb(void)
 {
        exitall_on_terminate = 1;
@@ -1669,10 +1652,12 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .name   = "percentage_random",
                .lname  = "Percentage Random",
                .type   = FIO_OPT_INT,
-               .cb     = str_perc_rand_cb,
+               .off1   = td_var_offset(perc_rand[DDIR_READ]),
+               .off2   = td_var_offset(perc_rand[DDIR_WRITE]),
+               .off3   = td_var_offset(perc_rand[DDIR_TRIM]),
                .maxval = 100,
                .help   = "Percentage of seq/random mix that should be random",
-               .def    = "100",
+               .def    = "100,100,100",
                .interval = 5,
                .inverse = "percentage_sequential",
                .category = FIO_OPT_C_IO,
@@ -1681,13 +1666,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
        {
                .name   = "percentage_sequential",
                .lname  = "Percentage Sequential",
-               .type   = FIO_OPT_INT,
-               .cb     = str_perc_seq_cb,
-               .maxval = 100,
-               .help   = "Percentage of seq/random mix that should be sequential",
-               .def    = "0",
-               .interval = 5,
-               .inverse = "percentage_random",
+               .type   = FIO_OPT_DEPRECATED,
                .category = FIO_OPT_C_IO,
                .group  = FIO_OPT_G_RANDOM,
        },