parse: enable options to be marked dont-free
authorJens Axboe <axboe@kernel.dk>
Wed, 12 Jul 2017 22:44:07 +0000 (16:44 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 12 Jul 2017 22:44:07 +0000 (16:44 -0600)
For profiles, we can't free the options prematurely.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
parse.c
parse.h
profiles/act.c
profiles/tiobench.c

diff --git a/parse.c b/parse.c
index 4d4fdddeae573f12e10270291785401029399d53..ecce8b89dba99f5bd8af7120d10a2843fac056cf 100644 (file)
--- 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 fb6abd1b22a21447562acd5b8d02014be95ca0bd..dfe7f1620c6aa762f217840dba89e663277fd7c2 100644 (file)
--- 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 *);
index cc1455db10bee0d8cbc375cb2e41cdab8e250f6d..4669535a9906f6b0ac34b45842de72681e30e268 100644 (file)
@@ -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",
index 9d9885a35788d4249652d511a0e176f532962def..f19a08577bb2450f0597cc9202e8c00c9eb495a6 100644 (file)
@@ -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",