summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2017-07-12 16:44:07 -0600
committerJens Axboe <axboe@kernel.dk>2017-07-12 16:44:07 -0600
commit43f466e667a8bcfc58c1c69b0897fe0345c34841 (patch)
treebab210e52e5bffab6e25894346fc535116a61496
parentdae887f3e2ac761886980cd3197522f3be46082d (diff)
parse: enable options to be marked dont-free
For profiles, we can't free the options prematurely. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--parse.c2
-rw-r--r--parse.h1
-rw-r--r--profiles/act.c1
-rw-r--r--profiles/tiobench.c1
4 files changed, 4 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 4d4fddd..ecce8b8 100644
--- a/parse.c
+++ b/parse.c
@@ -1345,7 +1345,7 @@ void options_free(struct fio_option *options, void *data)
dprint(FD_PARSE, "free options\n");
for (o = &options[0]; o->name; o++) {
- if (o->type != FIO_OPT_STR_STORE || !o->off1)
+ if (o->type != FIO_OPT_STR_STORE || !o->off1 || o->no_free)
continue;
ptr = td_var(data, o, o->off1);
diff --git a/parse.h b/parse.h
index fb6abd1..dfe7f16 100644
--- a/parse.h
+++ b/parse.h
@@ -78,6 +78,7 @@ struct fio_option {
int is_time; /* time based value */
int no_warn_def;
int pow2; /* must be a power-of-2 */
+ int no_free;
};
extern int parse_option(char *, const char *, struct fio_option *, struct fio_option **, void *, struct flist_head *);
diff --git a/profiles/act.c b/profiles/act.c
index cc1455d..4669535 100644
--- a/profiles/act.c
+++ b/profiles/act.c
@@ -89,6 +89,7 @@ static struct fio_option options[] = {
.help = "Devices to use",
.category = FIO_OPT_C_PROFILE,
.group = FIO_OPT_G_ACT,
+ .no_free = true,
},
{
.name = "load",
diff --git a/profiles/tiobench.c b/profiles/tiobench.c
index 9d9885a..f19a085 100644
--- a/profiles/tiobench.c
+++ b/profiles/tiobench.c
@@ -70,6 +70,7 @@ static struct fio_option options[] = {
.help = "Test directory",
.category = FIO_OPT_C_PROFILE,
.group = FIO_OPT_G_TIOBENCH,
+ .no_free = true,
},
{
.name = "threads",