Consider the maximum block size difference the minimum for loop exit
[fio.git] / backend.c
index 3567990b7e7e813ae1c1c0700cd8a8497d367ccf..ae4216db26c69b8fc23d1494a9f648965b882948 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -884,8 +884,7 @@ static int init_io_u(struct thread_data *td)
        char *p;
 
        max_units = td->o.iodepth;
        char *p;
 
        max_units = td->o.iodepth;
-       max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
-       max_bs = max(td->o.max_bs[DDIR_TRIM], max_bs);
+       max_bs = td_max_bs(td);
        min_write = td->o.min_bs[DDIR_WRITE];
        td->orig_buffer_size = (unsigned long long) max_bs
                                        * (unsigned long long) max_units;
        min_write = td->o.min_bs[DDIR_WRITE];
        td->orig_buffer_size = (unsigned long long) max_bs
                                        * (unsigned long long) max_units;
@@ -1042,7 +1041,7 @@ static int keep_running(struct thread_data *td)
                 * are done.
                 */
                diff = td->o.size - ddir_rw_sum(td->io_bytes);
                 * are done.
                 */
                diff = td->o.size - ddir_rw_sum(td->io_bytes);
-               if (diff < td->o.rw_min_bs)
+               if (diff < td_max_bs(td))
                        return 0;
 
                return 1;
                        return 0;
 
                return 1;