lfsr: don't pass in last value to lfsr_next()
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index c51982d88a2468254dda05796db69143c16f1142..33c82f2c4e9e85f692be0c03a0f1c241dd4539c2 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -83,13 +83,15 @@ struct rand_off {
 static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
                                  enum fio_ddir ddir, uint64_t *b)
 {
-       uint64_t r, lastb;
-
-       lastb = last_block(td, f, ddir);
-       if (!lastb)
-               return 1;
+       uint64_t r;
 
        if (td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE) {
+               uint64_t lastb;
+
+               lastb = last_block(td, f, ddir);
+               if (!lastb)
+                       return 1;
+
                r = __rand(&td->random_state);
 
                dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
@@ -98,7 +100,7 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
        } else {
                uint64_t off = 0;
 
-               if (lfsr_next(&f->lfsr, &off, lastb))
+               if (lfsr_next(&f->lfsr, &off))
                        return 1;
 
                *b = off;