backend: only check bytes_done for engines without FIO_NOIO
authorJens Axboe <axboe@kernel.dk>
Mon, 22 Oct 2012 18:36:26 +0000 (20:36 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Oct 2012 18:36:26 +0000 (20:36 +0200)
This basically reverts the functional part of commit 2557f7e6.
Instead of having to fiddle with the io_u manually, have
the backend check whether we expect data to have been transerred
or not.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
engines/cpu.c

index 3b42c4df4dd285678cb09433fa7b4d26c7fb2511..1c944d6a0de1fa53ea7bbb0785f0e48273cc6725 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -726,7 +726,7 @@ sync_done:
 
                if (ret < 0)
                        break;
-               if (!ddir_rw_sum(bytes_done))
+               if (!ddir_rw_sum(bytes_done) && !(td->io_ops->flags & FIO_NOIO))
                        continue;
 
                if (!in_ramp_time(td) && should_check_rate(td, bytes_done)) {
index 322dfde7412d9df075132bb8e3bd17c4ad713792..8bc9fd5c3c8c8919d4618bf6f149fb5b142093a6 100644 (file)
 static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u)
 {
        usec_spin(td->o.cpucycle);
-
-       if (io_u->buflen == 0)
-               io_u->buflen = 1;
-       io_u->resid = 0;
-
        return FIO_Q_COMPLETED;
 }