[PATCH] Add 'norandommap' option
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 45e8bb81ccc6e4dcfd7bbab57c781824c2d63161..04320794337454c3b5b2e0bdae115fd613273e42 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -91,6 +91,8 @@ static int get_next_offset(struct thread_data *td, struct fio_file *f,
                do {
                        r = os_random_long(&td->random_state);
                        b = ((max_blocks - 1) * r / (unsigned long long) (RAND_MAX+1.0));
+                       if (td->norandommap)
+                               break;
                        rb = b + (f->file_offset / td->min_bs);
                        loops--;
                } while (!random_map_free(td, f, rb) && loops);
@@ -211,7 +213,7 @@ static int fill_io_u(struct thread_data *td, struct fio_file *f,
                        /*
                         * If using a write iolog, store this entry.
                         */
-                       if (td->write_iolog)
+                       if (td->write_iolog_file)
                                write_iolog_put(td, io_u);
 
                        io_u->file = f;
@@ -277,7 +279,7 @@ struct io_u *get_io_u(struct thread_data *td, struct fio_file *f)
                        return NULL;
                }
 
-               if (!td->read_iolog && !td->sequential)
+               if (!td->read_iolog && !td->sequential && !td->norandommap)
                        mark_random_map(td, f, io_u);
 
                f->last_pos += io_u->buflen;