Fix broken 'norandommap'
[fio.git] / filesetup.c
index e7f5f1f39847f3865caa3599dea6c98b02a74ffd..9fb325bd18b392f1c1419a01a6518b34da6d90fb 100644 (file)
@@ -13,7 +13,7 @@
 #include "filehash.h"
 #include "os/os.h"
 #include "hash.h"
-#include "lib/bitmap.h"
+#include "lib/axmap.h"
 
 #ifdef FIO_HAVE_LINUX_FALLOCATE
 #include <linux/falloc.h>
@@ -911,7 +911,7 @@ int init_random_map(struct thread_data *td)
 
        if (init_rand_distribution(td))
                return 0;
-       if (td->o.norandommap || !td_random(td))
+       if (!td_random(td))
                return 0;
 
        for_each_file(td, f, i) {
@@ -920,11 +920,12 @@ int init_random_map(struct thread_data *td)
                if (td->o.random_generator == FIO_RAND_GEN_LFSR) {
                        if (!lfsr_init(&f->lfsr, blocks))
                                continue;
-               } else {
-                       f->io_bitmap = bitmap_new(blocks);
-                       if (f->io_bitmap)
+               } else if (!td->o.norandommap) {
+                       f->io_axmap = axmap_new(blocks);
+                       if (f->io_axmap)
                                continue;
-               }
+               } else if (td->o.norandommap)
+                       continue;
 
                if (!td->o.softrandommap) {
                        log_err("fio: failed allocating random map. If running"
@@ -972,8 +973,8 @@ void close_and_free_files(struct thread_data *td)
 
                sfree(f->file_name);
                f->file_name = NULL;
-               bitmap_free(f->io_bitmap);
-               f->io_bitmap = NULL;
+               axmap_free(f->io_axmap);
+               f->io_axmap = NULL;
                sfree(f);
        }