return 0;
if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
- val = 1.1;
+ val = FIO_DEF_ZIPF;
else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
- val = 0.2;
+ val = FIO_DEF_PARETO;
else
return 0;
return ret;
}
-static int str_lockfile_cb(void *data, const char fio_unused *str)
-{
- struct thread_data *td = data;
-
- if (td->files_index) {
- log_err("fio: lockfile= option must precede filename=\n");
- return 1;
- }
-
- return 0;
-}
-
static int str_opendir_cb(void *data, const char fio_unused *str)
{
struct thread_data *td = data;
return 0;
}
-static int str_gtod_cpu_cb(void *data, long long *il)
-{
- struct thread_data *td = data;
- int val = *il;
-
- td->o.gtod_cpu = val;
- td->o.gtod_offload = 1;
- return 0;
-}
-
static int str_size_cb(void *data, unsigned long long *__val)
{
struct thread_data *td = data;
.parent = "filename",
.hide = 0,
.def = "none",
- .cb = str_lockfile_cb,
.category = FIO_OPT_C_FILE,
.group = FIO_OPT_G_FILENAME,
.posval = {
.group = FIO_OPT_G_INVALID,
},
{
- .name = "io_limit",
- .lname = "IO Limit",
+ .name = "io_size",
+ .alias = "io_limit",
+ .lname = "IO Size",
.type = FIO_OPT_STR_VAL,
.off1 = td_var_offset(io_limit),
.interval = 1024 * 1024,
.name = "gtod_cpu",
.lname = "Dedicated gettimeofday() CPU",
.type = FIO_OPT_INT,
- .cb = str_gtod_cpu_cb,
+ .off1 = td_var_offset(gtod_cpu),
.help = "Set up dedicated gettimeofday() thread on this CPU",
.verify = gtod_cpu_verify,
.category = FIO_OPT_C_GENERAL,
return find_option(fio_options, name);
}
-int __fio_option_is_set(struct thread_options *o, unsigned int off1)
+static struct fio_option *find_next_opt(struct thread_options *o,
+ struct fio_option *from,
+ unsigned int off1)
{
- unsigned int opt_off, index, offset;
- struct fio_option *opt = NULL;
- int i;
+ struct fio_option *opt;
+
+ if (!from)
+ from = &fio_options[0];
+ else
+ from++;
- for (i = 0; fio_options[i].name; i++) {
- if (off1 == fio_options[i].off1) {
- opt = &fio_options[i];
+ opt = NULL;
+ do {
+ if (off1 == from->off1) {
+ opt = from;
break;
}
- }
+ from++;
+ } while (from->name);
- if (!opt) {
- log_err("fio: no option found at offset %u\n", off1);
- return 0;
- }
+ return opt;
+}
+
+static int opt_is_set(struct thread_options *o, struct fio_option *opt)
+{
+ unsigned int opt_off, index, offset;
opt_off = opt - &fio_options[0];
index = opt_off / (8 * sizeof(uint64_t));
return (o->set_options[index] & (1UL << offset)) != 0;
}
+int __fio_option_is_set(struct thread_options *o, unsigned int off1)
+{
+ struct fio_option *opt, *next;
+
+ next = NULL;
+ while ((opt = find_next_opt(o, next, off1)) != NULL) {
+ if (opt_is_set(o, opt))
+ return 1;
+
+ next = opt;
+ }
+
+ return 0;
+}
+
void fio_option_mark_set(struct thread_options *o, struct fio_option *opt)
{
unsigned int opt_off, index, offset;