From a80cb54b6df815c5121f84d5126e2550e5f259cc Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 17 Apr 2018 10:05:56 -0700 Subject: [PATCH] Change return type of td_io_commit() into void 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 --- backend.c | 12 +++--------- io_u.c | 7 ++----- ioengines.c | 15 ++++----------- ioengines.h | 2 +- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/backend.c b/backend.c index a2a0b3da..367910ec 100644 --- 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 633f6175..5b4c0df0 100644 --- 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; diff --git a/ioengines.c b/ioengines.c index a8ec79de..1d86848e 100644 --- a/ioengines.c +++ b/ioengines.c @@ -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) diff --git a/ioengines.h b/ioengines.h index a0674aea..7d265e74 100644 --- a/ioengines.h +++ b/ioengines.h @@ -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 *); -- 2.25.1