Update close file handler to return potential error
[fio.git] / ioengines.c
index 77c45f7ff05e1bc40224d2c4a784efa42add0a1c..a81c7b884b5df6352cca79d5e47bb5eae47b2973 100644 (file)
@@ -226,10 +226,11 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u)
        if (io_u->ddir != DDIR_SYNC)
                td->io_issues[io_u->ddir]++;
 
-       io_u_mark_depth(td, io_u);
-
        ret = td->io_ops->queue(td, io_u);
 
+       if (ret != FIO_Q_BUSY)
+               io_u_mark_depth(td, io_u);
+
        if (ret == FIO_Q_QUEUED) {
                int r;
 
@@ -343,7 +344,7 @@ err:
        return 1;
 }
 
-void td_io_close_file(struct thread_data *td, struct fio_file *f)
+int td_io_close_file(struct thread_data *td, struct fio_file *f)
 {
        if (!(f->flags & FIO_FILE_CLOSING))
                log_file(td, f, FIO_LOG_CLOSE_FILE);
@@ -353,5 +354,5 @@ void td_io_close_file(struct thread_data *td, struct fio_file *f)
         */
        f->flags |= FIO_FILE_CLOSING;
 
-       put_file(td, f);
+       return put_file(td, f);
 }