summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorTomohiro Kusumi <tkusumi@tuxera.com>2017-01-19 02:38:26 +0900
committerJens Axboe <axboe@fb.com>2017-01-19 16:09:52 -0700
commit53b5693d04b0de440ce3eb1fa22834ef46d0a4e3 (patch)
tree7bb73d5aa65035e4f80f87a94c6a4d9df12a9e8b /options.c
parent755dcbbdec670a0c2e83561070d5fd1462c75dc6 (diff)
downloadfio-53b5693d04b0de440ce3eb1fa22834ef46d0a4e3.tar.gz
fio-53b5693d04b0de440ce3eb1fa22834ef46d0a4e3.tar.bz2
Move options_mem_dupe() to parse.c
This function should be in parse.c with fio_option* argument first. Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'options.c')
-rw-r--r--options.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/options.c b/options.c
index 1ca16e84..713112f6 100644
--- a/options.c
+++ b/options.c
@@ -4772,34 +4772,19 @@ int fio_show_option_help(const char *opt)
return show_cmd_help(fio_options, opt);
}
-void options_mem_dupe(void *data, struct fio_option *options)
-{
- struct fio_option *o;
- char **ptr;
-
- for (o = &options[0]; o->name; o++) {
- if (o->type != FIO_OPT_STR_STORE)
- continue;
-
- ptr = td_var(data, o, o->off1);
- if (*ptr)
- *ptr = strdup(*ptr);
- }
-}
-
/*
* dupe FIO_OPT_STR_STORE options
*/
void fio_options_mem_dupe(struct thread_data *td)
{
- options_mem_dupe(&td->o, fio_options);
+ options_mem_dupe(fio_options, &td->o);
if (td->eo && td->io_ops) {
void *oldeo = td->eo;
td->eo = malloc(td->io_ops->option_struct_size);
memcpy(td->eo, oldeo, td->io_ops->option_struct_size);
- options_mem_dupe(td->eo, td->io_ops->options);
+ options_mem_dupe(td->io_ops->options, td->eo);
}
}