From 3bec7ae05cbec8823943a9aca79871c99709ed5f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 14 May 2008 21:08:37 +0200 Subject: [PATCH] Allow marking of queue depth for more than 1 io_u at the time Same code as before, just prepared for it. Signed-off-by: Jens Axboe --- fio.h | 2 +- io_u.c | 7 ++++--- ioengines.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fio.h b/fio.h index 6f2c4c09..f201b33b 100644 --- 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 985c99b2..0ba48416 100644 --- 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) diff --git a/ioengines.c b/ioengines.c index e44fce08..984c01ac 100644 --- a/ioengines.c +++ b/ioengines.c @@ -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; -- 2.25.1