summaryrefslogtreecommitdiff
path: root/parse.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 /parse.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 'parse.c')
-rw-r--r--parse.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 518c2dff..fc508b67 100644
--- a/parse.c
+++ b/parse.c
@@ -1319,6 +1319,23 @@ void options_init(struct fio_option *options)
}
}
+void options_mem_dupe(struct fio_option *options, void *data)
+{
+ struct fio_option *o;
+ char **ptr;
+
+ dprint(FD_PARSE, "dup options\n");
+
+ 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);
+ }
+}
+
void options_free(struct fio_option *options, void *data)
{
struct fio_option *o;