From: Bart Van Assche Date: Wed, 18 Apr 2018 20:06:59 +0000 (-0700) Subject: Remove dead code from fio_io_sync() X-Git-Tag: fio-3.7~23^2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=18f6165ecf9fd73a1bf5db79f7e80df45e31d52f 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 --- 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; }