Allow marking of queue depth for more than 1 io_u at the time
authorJens Axboe <jens.axboe@oracle.com>
Wed, 14 May 2008 19:08:37 +0000 (21:08 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 14 May 2008 19:08:37 +0000 (21:08 +0200)
Same code as before, just prepared for it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.h
io_u.c
ioengines.c

diff --git a/fio.h b/fio.h
index 6f2c4c09810c3e1c379c8570db70384412ba274c..f201b33b1d5f8b44123ecab36a1f1f97fc93663f 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -906,7 +906,7 @@ extern void io_u_queued(struct thread_data *, struct io_u *);
 extern void io_u_log_error(struct thread_data *, struct io_u *);
 extern void io_u_init_timeout(void);
 extern void io_u_set_timeout(struct thread_data *);
-extern void io_u_mark_depth(struct thread_data *, struct io_u *);
+extern void io_u_mark_depth(struct thread_data *, struct io_u *, unsigned int);
 
 /*
  * io engine entry points
diff --git a/io_u.c b/io_u.c
index 985c99b2bb7f1094ee28804bfcef060987cb3446..0ba484169d31d024a041ddfc43b3baedc4b0f193 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -410,7 +410,8 @@ out:
        return 0;
 }
 
-void io_u_mark_depth(struct thread_data *td, struct io_u *io_u)
+void io_u_mark_depth(struct thread_data *td, struct io_u *io_u,
+                    unsigned int nr)
 {
        int index = 0;
 
@@ -439,8 +440,8 @@ void io_u_mark_depth(struct thread_data *td, struct io_u *io_u)
                break;
        }
 
-       td->ts.io_u_map[index]++;
-       td->ts.total_io_u[io_u->ddir]++;
+       td->ts.io_u_map[index] += nr;
+       td->ts.total_io_u[io_u->ddir] += nr;
 }
 
 static void io_u_mark_lat_usec(struct thread_data *td, unsigned long usec)
index e44fce08b51065cf4d6ad9feaf87f6878ee4ff25..984c01ac7e6442a99868ee03388a684c654318e8 100644 (file)
@@ -238,7 +238,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u)
        unlock_file(td, io_u->file);
 
        if (ret != FIO_Q_BUSY)
-               io_u_mark_depth(td, io_u);
+               io_u_mark_depth(td, io_u, 1);
 
        if (ret == FIO_Q_QUEUED) {
                int r;