X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=io_u.c;h=d81fefdeefe2269e2be9df49d976cc7c0c801c22;hb=39b9356872f27c1a48a2ab09a5252dffd1de22d2;hp=688249bd8a727e7910d72388a829f7249b5ee059;hpb=925fee33e47f7eb755ee893e87f0de2bd405a8cc;p=fio.git diff --git a/io_u.c b/io_u.c index 688249bd..d81fefde 100644 --- a/io_u.c +++ b/io_u.c @@ -238,7 +238,7 @@ static int __get_next_rand_offset_zipf(struct thread_data *td, struct fio_file *f, enum fio_ddir ddir, unsigned long long *b) { - *b = zipf_next(&td->zipf); + *b = zipf_next(&f->zipf); return 0; } @@ -246,7 +246,7 @@ static int __get_next_rand_offset_pareto(struct thread_data *td, struct fio_file *f, enum fio_ddir ddir, unsigned long long *b) { - *b = pareto_next(&td->zipf); + *b = pareto_next(&f->zipf); return 0; } @@ -413,7 +413,7 @@ static inline int io_u_fits(struct thread_data *td, struct io_u *io_u, static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u) { const int ddir = io_u->ddir; - unsigned int uninitialized_var(buflen); + unsigned int buflen = 0; unsigned int minbs, maxbs; unsigned long r, rand_max; @@ -1345,7 +1345,7 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u, struct io_completion_data *icd, const enum fio_ddir idx, unsigned int bytes) { - unsigned long uninitialized_var(lusec); + unsigned long lusec = 0; if (!td->o.disable_clat || !td->o.disable_bw) lusec = utime_since(&io_u->issue_time, &icd->time); @@ -1359,8 +1359,8 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u, if (td->o.max_latency && tusec > td->o.max_latency) { if (!td->error) log_err("fio: latency of %lu usec exceeds specified max (%u usec)\n", tusec, td->o.max_latency); - td_verror(td, ETIME, "max latency exceeded"); - icd->error = ETIME; + td_verror(td, ETIMEDOUT, "max latency exceeded"); + icd->error = ETIMEDOUT; } } @@ -1388,11 +1388,6 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir) static void io_completed(struct thread_data *td, struct io_u *io_u, struct io_completion_data *icd) { - /* - * Older gcc's are too dumb to realize that usec is always used - * initialized, silence that warning. - */ - unsigned long uninitialized_var(usec); struct fio_file *f; dprint_io_u(io_u, "io complete");