+int __fio_option_is_set(struct thread_options *o, unsigned int off1)
+{
+ unsigned int opt_off, index, offset;
+ struct fio_option *opt = NULL;
+ int i;
+
+ for (i = 0; fio_options[i].name; i++) {
+ if (off1 == fio_options[i].off1) {
+ opt = &fio_options[i];
+ break;
+ }
+ }
+
+ if (!opt) {
+ log_err("fio: no option found at offset %u\n", off1);
+ return 0;
+ }
+
+ opt_off = opt - &fio_options[0];
+ index = opt_off / (8 * sizeof(uint64_t));
+ offset = opt_off & ((8 * sizeof(uint64_t)) - 1);
+ return (o->set_options[index] & (1UL << offset)) != 0;
+}
+
+void fio_option_mark_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));
+ offset = opt_off & ((8 * sizeof(uint64_t)) - 1);
+ o->set_options[index] |= 1UL << offset;
+}