From 18f6165ecf9fd73a1bf5db79f7e80df45e31d52f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 18 Apr 2018 13:06:59 -0700 Subject: [PATCH] Remove dead code from fio_io_sync() Due to the previous patch it is now guaranteed that the I/O engine queue function returns a FIO_Q_* value. These values are >= 0. Hence remove the code that depends on the queue function returning a negative value. Signed-off-by: Bart Van Assche --- backend.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/backend.c b/backend.c index 367910ec..3774df58 100644 --- a/backend.c +++ b/backend.c @@ -283,15 +283,13 @@ static bool fio_io_sync(struct thread_data *td, struct fio_file *f) requeue: ret = td_io_queue(td, io_u); - if (ret < 0) { - td_verror(td, io_u->error, "td_io_queue"); - put_io_u(td, io_u); - return true; - } else if (ret == FIO_Q_QUEUED) { + switch (ret) { + case FIO_Q_QUEUED: td_io_commit(td); if (io_u_queued_complete(td, 1) < 0) return true; - } else if (ret == FIO_Q_COMPLETED) { + break; + case FIO_Q_COMPLETED: if (io_u->error) { td_verror(td, io_u->error, "td_io_queue"); return true; @@ -299,7 +297,8 @@ requeue: if (io_u_sync_complete(td, io_u) < 0) return true; - } else if (ret == FIO_Q_BUSY) { + break; + case FIO_Q_BUSY: td_io_commit(td); goto requeue; } -- 2.25.1