io_u: use nsec value for buffer scramble
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index ebe82e12e8f091b02dc4dd71c708435b642dcbc1..8087bd6a119217e9df7954bfec52a4afaea1dcd7 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1673,8 +1673,8 @@ static bool check_get_verify(struct thread_data *td, struct io_u *io_u)
 static void small_content_scramble(struct io_u *io_u)
 {
        unsigned int i, nr_blocks = io_u->buflen / 512;
-       uint64_t boffset, usec;
        unsigned int offset;
+       uint64_t boffset;
        char *p, *end;
 
        if (!nr_blocks)
@@ -1684,16 +1684,13 @@ static void small_content_scramble(struct io_u *io_u)
        boffset = io_u->offset;
        io_u->buf_filled_len = 0;
 
-       /* close enough for this purpose */
-       usec = io_u->start_time.tv_nsec >> 10;
-
        for (i = 0; i < nr_blocks; i++) {
                /*
                 * Fill the byte offset into a "random" start offset of
                 * the buffer, given by the product of the usec time
                 * and the actual offset.
                 */
-               offset = (usec ^ boffset) & 511;
+               offset = (io_u->start_time.tv_nsec ^ boffset) & 511;
                offset &= ~(sizeof(uint64_t) - 1);
                if (offset >= 512 - sizeof(uint64_t))
                        offset -= sizeof(uint64_t);