X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=b5ced8898311d7684103b47dcf552d62ee8c59ef;hb=refs%2Ftags%2Ffio-1.36;hp=873a0ba68e4884f50f457bb0786efe32ca8e1878;hpb=8eb76f78b96cfc1b1ab7b5f629e90c39ca7375fc;p=fio.git diff --git a/init.c b/init.c index 873a0ba6..b5ced889 100644 --- a/init.c +++ b/init.c @@ -20,7 +20,7 @@ #include "filehash.h" #include "verify.h" -static char fio_version_string[] = "fio 1.36-rc1"; +static char fio_version_string[] = "fio 1.36"; #define FIO_RANDSEED (0xb1899bedUL) @@ -181,6 +181,8 @@ static struct thread_data *get_new_job(int global, struct thread_data *parent) td = &threads[thread_number++]; *td = *parent; + td->o.uid = td->o.gid = -1U; + dup_files(td, parent); options_mem_dupe(td); @@ -203,21 +205,19 @@ static void put_job(struct thread_data *td) static int __setup_rate(struct thread_data *td, enum fio_ddir ddir) { unsigned int bs = td->o.min_bs[ddir]; - unsigned long long rate; - unsigned long ios_per_msec; + unsigned long long bytes_per_sec; - if (td->o.rate[ddir]) { - rate = td->o.rate[ddir]; - ios_per_msec = (rate * 1000LL) / bs; - } else - ios_per_msec = td->o.rate_iops[ddir] * 1000UL; + if (td->o.rate[ddir]) + bytes_per_sec = td->o.rate[ddir]; + else + bytes_per_sec = td->o.rate_iops[ddir] * bs; - if (!ios_per_msec) { + if (!bytes_per_sec) { log_err("rate lower than supported\n"); return -1; } - td->rate_usec_cycle[ddir] = 1000000000ULL / ios_per_msec; + td->rate_nsec_cycle[ddir] = 1000000000ULL / bytes_per_sec; td->rate_pending_usleep[ddir] = 0; return 0; }