return 1;
}
-static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
- enum fio_ddir ddir, unsigned long long *b)
+static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
+ enum fio_ddir ddir, unsigned long long *b)
{
unsigned long long rmax, r, lastb;
int loops = 5;
return 0;
}
+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(&f->zipf);
+ return 0;
+}
+
+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(&f->zipf);
+ return 0;
+}
+
+static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
+ enum fio_ddir ddir, unsigned long long *b)
+{
+ if (td->o.random_distribution == FIO_RAND_DIST_RANDOM)
+ return __get_next_rand_offset(td, f, ddir, b);
+ else if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
+ return __get_next_rand_offset_zipf(td, f, ddir, b);
+ else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
+ return __get_next_rand_offset_pareto(td, f, ddir, b);
+
+ log_err("fio: unknown random distribution: %d\n", td->o.random_distribution);
+ return 1;
+}
+
static int get_next_rand_block(struct thread_data *td, struct fio_file *f,
enum fio_ddir ddir, unsigned long long *b)
{
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;
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);
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;
}
}
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");