io_u: make io_u_quiesce() return how many IOs it completed
authorJens Axboe <axboe@fb.com>
Fri, 4 Dec 2015 02:58:23 +0000 (19:58 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 4 Dec 2015 02:58:23 +0000 (19:58 -0700)
Ditto for io_u_queued_complete().

Signed-off-by: Jens Axboe <axboe@fb.com>
io_u.c
ioengine.h

diff --git a/io_u.c b/io_u.c
index d45a6f010a92f31b2f27f55777e61c17348dc5b5..f86367bd707a89a425130471a99412d3dff0c206 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -542,8 +542,10 @@ static inline enum fio_ddir get_rand_ddir(struct thread_data *td)
        return DDIR_WRITE;
 }
 
-void io_u_quiesce(struct thread_data *td)
+int io_u_quiesce(struct thread_data *td)
 {
+       int completed = 0;
+
        /*
         * We are going to sleep, ensure that we flush anything pending as
         * not to skew our latency numbers.
@@ -563,7 +565,11 @@ void io_u_quiesce(struct thread_data *td)
                int fio_unused ret;
 
                ret = io_u_queued_complete(td, 1);
+               if (ret > 0)
+                       completed += ret;
        }
+
+       return completed;
 }
 
 static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir)
@@ -1856,7 +1862,7 @@ int io_u_queued_complete(struct thread_data *td, int min_evts)
        for (ddir = DDIR_READ; ddir < DDIR_RWDIR_CNT; ddir++)
                td->bytes_done[ddir] += icd.bytes_done[ddir];
 
-       return 0;
+       return ret;
 }
 
 /*
index c557f7a8c2f2545a3bd0b2cae2e99df0f58d5523..37f0336a616d2e107e6eb509aad54fb3753ffafa 100644 (file)
@@ -214,7 +214,7 @@ extern void requeue_io_u(struct thread_data *, struct io_u **);
 extern int __must_check io_u_sync_complete(struct thread_data *, struct io_u *);
 extern int __must_check io_u_queued_complete(struct thread_data *, int);
 extern void io_u_queued(struct thread_data *, struct io_u *);
-extern void io_u_quiesce(struct thread_data *);
+extern int io_u_quiesce(struct thread_data *);
 extern void io_u_log_error(struct thread_data *, struct io_u *);
 extern void io_u_mark_depth(struct thread_data *, unsigned int);
 extern void fill_io_buffer(struct thread_data *, void *, unsigned int, unsigned int);