Remove dead code from fio_io_sync()
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 18 Apr 2018 20:06:59 +0000 (13:06 -0700)
committerBart Van Assche <bart.vanassche@wdc.com>
Wed, 18 Apr 2018 20:25:30 +0000 (13:25 -0700)
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 <bart.vanassche@wdc.com>
backend.c

index 367910ecda2a08d88dc6e57823b5e80f3c726d9a..3774df58442e086715e8e8c7c0a63bbf04a4b220 100644 (file)
--- 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;
        }