implement zoned random I/O testing support

This fixes the limitation that prevents fio from doing random I/O with zones
enabled.

This also adds a 'zonerange' configuration option which may be too ambiguous
and is subject to potential renaming in the future.

When doing random I/O, it is beneficial to be able to specify how large the
addressible space is in the zone, while specifying a different metric for
how much data to read from that zone (i.e., how many samples to take from each
zone). When 'zonerange' is not specified, it defaults to be equal to the
'zonesize' option. When both are specified, 'zonerange' indicates the
size of the zone while 'zonesize' indicates the quantity of data to read from
each zone.

Signed-off-by: Steven Noonan <snoonan@amazon.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/init.c b/init.c
index 381bb65..4a3716b 100644
--- a/init.c
+++ b/init.c
@@ -402,12 +402,19 @@
 	}
 
 	/*
-	 * only really works for sequential io for now, and with 1 file
+	 * only really works with 1 file
 	 */
-	if (o->zone_size && td_random(td) && o->open_files == 1)
+	if (o->zone_size && o->open_files == 1)
 		o->zone_size = 0;
 
 	/*
+	 * If zone_range isn't specified, backward compatibility dictates it
+	 * should be made equal to zone_size.
+	 */
+	if (o->zone_size && !o->zone_range)
+		o->zone_range = o->zone_size;
+
+	/*
 	 * Reads can do overwrites, we always need to pre-create the file
 	 */
 	if (td_read(td) || td_rw(td))