Add support for randomness of any IO direction

sequential_random used to be applied to all of the IO
directions, with no possibility of having different settings
for reads, writes, and trims. Now it supports setting each of
them individually.

By default, if you do:

sequential_random=50

it will still apply to all three. If you do:

sequential_random=10,90,80

you would get reads 10% random, writes 90% random, and trims
80% random.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/options.c b/options.c
index 1c44f42..3da376e 100644
--- a/options.c
+++ b/options.c
@@ -377,23 +377,6 @@
 	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 @@
 		.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 @@
 	{
 		.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,
 	},