Change return type of td_io_commit() into void
authorBart Van Assche <bart.vanassche@wdc.com>
Tue, 17 Apr 2018 17:05:56 +0000 (10:05 -0700)
committerBart Van Assche <bart.vanassche@wdc.com>
Wed, 18 Apr 2018 20:25:30 +0000 (13:25 -0700)
Since td_io_commit() always returns 0, change its return type from
int into void. This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
backend.c
io_u.c
ioengines.c
ioengines.h

index a2a0b3da61458f4e6171c868f2fb07b4b77faa38..367910ecda2a08d88dc6e57823b5e80f3c726d9a 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -288,8 +288,7 @@ requeue:
                put_io_u(td, io_u);
                return true;
        } else if (ret == FIO_Q_QUEUED) {
-               if (td_io_commit(td))
-                       return true;
+               td_io_commit(td);
                if (io_u_queued_complete(td, 1) < 0)
                        return true;
        } else if (ret == FIO_Q_COMPLETED) {
@@ -301,8 +300,7 @@ requeue:
                if (io_u_sync_complete(td, io_u) < 0)
                        return true;
        } else if (ret == FIO_Q_BUSY) {
-               if (td_io_commit(td))
-                       return true;
+               td_io_commit(td);
                goto requeue;
        }
 
@@ -453,8 +451,6 @@ int io_queue_event(struct thread_data *td, struct io_u *io_u, int *ret,
                   enum fio_ddir ddir, uint64_t *bytes_issued, int from_verify,
                   struct timespec *comp_time)
 {
-       int ret2;
-
        switch (*ret) {
        case FIO_Q_COMPLETED:
                if (io_u->error) {
@@ -530,9 +526,7 @@ sync_done:
                if (!from_verify)
                        unlog_io_piece(td, io_u);
                requeue_io_u(td, &io_u);
-               ret2 = td_io_commit(td);
-               if (ret2 < 0)
-                       *ret = ret2;
+               td_io_commit(td);
                break;
        default:
                assert(*ret < 0);
diff --git a/io_u.c b/io_u.c
index 633f6175170f4c88004c71fa14e756cf55d22480..5b4c0df06ad5774aa6ffde99407465b5d8335e61 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -610,11 +610,8 @@ int io_u_quiesce(struct thread_data *td)
         * io's that have been actually submitted to an async engine,
         * and cur_depth is meaningless for sync engines.
         */
-       if (td->io_u_queued || td->cur_depth) {
-               int fio_unused ret;
-
-               ret = td_io_commit(td);
-       }
+       if (td->io_u_queued || td->cur_depth)
+               td_io_commit(td);
 
        while (td->io_u_in_flight) {
                int ret;
index a8ec79de473bf235424e9fac80996c112a744364..1d86848e4062afd7bd27bef7b61fb251d8f69d3c 100644 (file)
@@ -361,18 +361,13 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u)
                        td->ts.total_io_u[io_u->ddir]++;
                }
        } else if (ret == FIO_Q_QUEUED) {
-               int r;
-
                td->io_u_queued++;
 
                if (ddir_rw(io_u->ddir) || ddir_sync(io_u->ddir))
                        td->ts.total_io_u[io_u->ddir]++;
 
-               if (td->io_u_queued >= td->o.iodepth_batch) {
-                       r = td_io_commit(td);
-                       if (r < 0)
-                               return r;
-               }
+               if (td->io_u_queued >= td->o.iodepth_batch)
+                       td_io_commit(td);
        }
 
        if (!td_ioengine_flagged(td, FIO_SYNCIO)) {
@@ -410,14 +405,14 @@ int td_io_init(struct thread_data *td)
        return ret;
 }
 
-int td_io_commit(struct thread_data *td)
+void td_io_commit(struct thread_data *td)
 {
        int ret;
 
        dprint(FD_IO, "calling ->commit(), depth %d\n", td->cur_depth);
 
        if (!td->cur_depth || !td->io_u_queued)
-               return 0;
+               return;
 
        io_u_mark_depth(td, td->io_u_queued);
 
@@ -432,8 +427,6 @@ int td_io_commit(struct thread_data *td)
         */
        td->io_u_in_flight += td->io_u_queued;
        td->io_u_queued = 0;
-
-       return 0;
 }
 
 int td_io_open_file(struct thread_data *td, struct fio_file *f)
index a0674aeabebfd5cccc49fb2a578b736dbac58054..7d265e7471f35c2b1f30f7c79851713bb6bd5bba 100644 (file)
@@ -76,7 +76,7 @@ extern int __must_check td_io_init(struct thread_data *);
 extern int __must_check td_io_prep(struct thread_data *, struct io_u *);
 extern int __must_check td_io_queue(struct thread_data *, struct io_u *);
 extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
-extern int __must_check td_io_commit(struct thread_data *);
+extern void td_io_commit(struct thread_data *);
 extern int __must_check td_io_open_file(struct thread_data *, struct fio_file *);
 extern int td_io_close_file(struct thread_data *, struct fio_file *);
 extern int td_io_unlink_file(struct thread_data *, struct fio_file *);