Make options mask a 64-bit type
[fio.git] / options.c
index caa00af8f5e1dcf9c74c24ef8c1a4b1ea344e5d8..8494713977a215dd9c22110b15edb83cbfd38b85 100644 (file)
--- a/options.c
+++ b/options.c
@@ -536,6 +536,7 @@ static int str_verify_cpus_allowed_cb(void *data, const char *input)
        return set_cpus_allowed(td, &td->o.verify_cpumask, input);
 }
 
+#ifdef CONFIG_ZLIB
 static int str_log_cpus_allowed_cb(void *data, const char *input)
 {
        struct thread_data *td = data;
@@ -545,8 +546,9 @@ static int str_log_cpus_allowed_cb(void *data, const char *input)
 
        return set_cpus_allowed(td, &td->o.log_gz_cpumask, input);
 }
+#endif /* CONFIG_ZLIB */
 
-#endif
+#endif /* FIO_HAVE_CPU_AFFINITY */
 
 #ifdef CONFIG_LIBNUMA
 static int str_numa_cpunodes_cb(void *data, char *input)
@@ -1073,8 +1075,9 @@ static struct opt_group fio_opt_groups[] = {
        },
 };
 
-static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask,
-                                              unsigned int inv_mask)
+static struct opt_group *__opt_group_from_mask(struct opt_group *ogs,
+                                              uint64_t *mask,
+                                              uint64_t inv_mask)
 {
        struct opt_group *og;
        int i;
@@ -1094,7 +1097,7 @@ static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned i
        return NULL;
 }
 
-struct opt_group *opt_group_from_mask(unsigned int *mask)
+struct opt_group *opt_group_from_mask(uint64_t *mask)
 {
        return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID);
 }
@@ -1198,7 +1201,7 @@ static struct opt_group fio_opt_cat_groups[] = {
        }
 };
 
-struct opt_group *opt_group_cat_from_mask(unsigned int *mask)
+struct opt_group *opt_group_cat_from_mask(uint64_t *mask)
 {
        return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID);
 }
@@ -4081,20 +4084,16 @@ static void show_closest_option(const char *opt)
 
 int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
 {
-       struct flist_head *opt_list = NULL;
        int i, ret, unknown;
        char **opts_copy;
 
-       if (!is_def_thread(td))
-               opt_list = &td->opt_list;
-
        sort_options(opts, fio_options, num_opts);
        opts_copy = dup_and_sub_options(opts, num_opts);
 
        for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) {
                struct fio_option *o;
                int newret = parse_option(opts_copy[i], opts[i], fio_options,
-                                               &o, td, opt_list);
+                                               &o, td, &td->opt_list);
 
                if (!newret && o)
                        fio_option_mark_set(&td->o, o);
@@ -4127,7 +4126,7 @@ int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
                        if (td->eo)
                                newret = parse_option(opts_copy[i], opts[i],
                                                      td->io_ops->options, &o,
-                                                     td->eo, opt_list);
+                                                     td->eo, &td->opt_list);
 
                        ret |= newret;
                        if (!o) {
@@ -4147,7 +4146,7 @@ int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)
 {
        int ret;
 
-       ret = parse_cmd_option(opt, val, fio_options, td);
+       ret = parse_cmd_option(opt, val, fio_options, td, &td->opt_list);
        if (!ret) {
                struct fio_option *o;
 
@@ -4162,7 +4161,8 @@ int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)
 int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt,
                                char *val)
 {
-       return parse_cmd_option(opt, val, td->io_ops->options, td->eo);
+       return parse_cmd_option(opt, val, td->io_ops->options, td->eo,
+                                       &td->opt_list);
 }
 
 void fio_fill_default_options(struct thread_data *td)
@@ -4351,19 +4351,19 @@ static int opt_is_set(struct thread_options *o, struct fio_option *opt)
        return (o->set_options[index] & ((uint64_t)1 << offset)) != 0;
 }
 
-int __fio_option_is_set(struct thread_options *o, unsigned int off1)
+bool __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;
+                       return true;
 
                next = opt;
        }
 
-       return 0;
+       return false;
 }
 
 void fio_option_mark_set(struct thread_options *o, struct fio_option *opt)