Rate must always calculate bytes done
[fio.git] / engines / mmap.c
index 08bbd991463d4e8546ea40a31d14b9213ffd0d11..bd59b28a6cf99f0900f978d175cbb68c336dfa00 100644 (file)
@@ -37,7 +37,7 @@ static int fio_mmapio_queue(struct thread_data *td, struct io_u *io_u)
        }
 
        if (io_u->error)
-               td_verror(td, io_u->error);
+               td_verror(td, io_u->error, "sync");
 
        return FIO_Q_COMPLETED;
 }
@@ -47,7 +47,7 @@ static int fio_mmapio_init(struct thread_data *td)
        struct fio_file *f;
        int i;
 
-       if (td->ddir == DDIR_READ && !td_rw(td))
+       if (!td_write(td))
                return 0;
 
        /*
@@ -56,7 +56,7 @@ static int fio_mmapio_init(struct thread_data *td)
         */
        for_each_file(td, f, i) {
                if (ftruncate(f->fd, f->file_size) < 0) {
-                       td_verror(td, errno);
+                       td_verror(td, errno, "ftruncate");
                        return 1;
                }
        }