Only initialize random map if we are actually going to use it
authorJens Axboe <jens.axboe@oracle.com>
Sat, 1 Mar 2008 14:34:44 +0000 (15:34 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Sat, 1 Mar 2008 14:34:44 +0000 (15:34 +0100)
We alloc the randommap even for sequential workloads right now,
if the 'norandommap' option isn't given. Fix that, check for
td_random() before continuing.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index d10840a..b29db3f 100644 (file)
@@ -497,7 +497,7 @@ int init_random_map(struct thread_data *td)
        struct fio_file *f;
        unsigned int i;
 
-       if (td->o.norandommap)
+       if (td->o.norandommap || !td_random(td))
                return 0;
 
        for_each_file(td, f, i) {