Add 'f' (Finishing) flag to status output
[fio.git] / backend.c
index 72d9d6d2d6d1d47efe7360e8c4519a7e65c4e99c..1ff8b3f6e298adfa7f756453edf2cff1656b91f8 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -623,6 +623,19 @@ reap:
        dprint(FD_VERIFY, "exiting loop\n");
 }
 
+static unsigned int exceeds_number_ios(struct thread_data *td)
+{
+       unsigned long long number_ios;
+
+       if (!td->o.number_ios)
+               return 0;
+
+       number_ios = ddir_rw_sum(td->this_io_blocks);
+       number_ios += td->io_u_queued + td->io_u_in_flight;
+
+       return number_ios >= td->o.number_ios;
+}
+
 static int io_bytes_exceeded(struct thread_data *td)
 {
        unsigned long long bytes;
@@ -636,7 +649,7 @@ static int io_bytes_exceeded(struct thread_data *td)
        else
                bytes = td->this_io_bytes[DDIR_TRIM];
 
-       return bytes >= td->o.size;
+       return bytes >= td->o.size || exceeds_number_ios(td);
 }
 
 /*
@@ -1127,6 +1140,8 @@ static int keep_running(struct thread_data *td)
                td->o.loops--;
                return 1;
        }
+       if (exceeds_number_ios(td))
+               return 0;
 
        if (td->o.size != -1ULL && ddir_rw_sum(td->io_bytes) < td->o.size) {
                uint64_t diff;
@@ -1196,6 +1211,12 @@ static uint64_t do_dry_run(struct thread_data *td)
                        td->ts.total_io_u[io_u->ddir]++;
                }
 
+               if (td_write(td) && io_u->ddir == DDIR_WRITE &&
+                   td->o.do_verify &&
+                   td->o.verify != VERIFY_NONE &&
+                   !td->o.experimental_verify)
+                       log_io_piece(td, io_u);
+
                ret = io_u_sync_complete(td, io_u, bytes_done);
                (void) ret;
        }