From 43f466e667a8bcfc58c1c69b0897fe0345c34841 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 12 Jul 2017 16:44:07 -0600 Subject: [PATCH] parse: enable options to be marked dont-free For profiles, we can't free the options prematurely. Signed-off-by: Jens Axboe --- parse.c | 2 +- parse.h | 1 + profiles/act.c | 1 + profiles/tiobench.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/parse.c b/parse.c index 4d4fddde..ecce8b89 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 fb6abd1b..dfe7f162 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 cc1455db..4669535a 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 9d9885a3..f19a0857 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", -- 2.25.1