X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=ae4216db26c69b8fc23d1494a9f648965b882948;hp=d1fe9641d88ebaa47489fc10a8f039e9443bbc10;hb=74f4b020b3c8053ff319c3da900a5cf07e51c8eb;hpb=61ee0f86fc428db9403f0c1123e4c2f125152466 diff --git a/backend.c b/backend.c index d1fe9641..ae4216db 100644 --- a/backend.c +++ b/backend.c @@ -34,12 +34,12 @@ #include #include #include -#ifndef FIO_NO_HAVE_SHM_H -#include -#endif #include #include "fio.h" +#ifndef FIO_NO_HAVE_SHM_H +#include +#endif #include "hash.h" #include "smalloc.h" #include "verify.h" @@ -884,8 +884,7 @@ static int init_io_u(struct thread_data *td) 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; @@ -1034,7 +1033,7 @@ static int keep_running(struct thread_data *td) return 1; } - if (ddir_rw_sum(td->io_bytes) < td->o.size) { + if (td->o.size != -1ULL && ddir_rw_sum(td->io_bytes) < td->o.size) { uint64_t diff; /* @@ -1042,7 +1041,7 @@ static int keep_running(struct thread_data *td) * 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;