X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=e255e94f78cd552f35f53e0de9080bd04f94cf27;hp=3d32c8e05fbd68504a80721b685283f13a47bd08;hb=0d29de831183dfd049c97a03008d425ce21e2fa4;hpb=d1c46c049cfba2028abc45246e2609bcee52d0f3;ds=inline diff --git a/options.c b/options.c index 3d32c8e0..e255e94f 100644 --- a/options.c +++ b/options.c @@ -440,6 +440,16 @@ static int str_verify_cpus_allowed_cb(void *data, const char *input) } #endif +#ifdef FIO_HAVE_TRIM +static int str_verify_trim_cb(void *data, unsigned long long *val) +{ + struct thread_data *td = data; + + td->o.trim_percentage = *val; + return 0; +} +#endif + static int str_fst_cb(void *data, const char *str) { struct thread_data *td = data; @@ -1458,7 +1468,7 @@ static struct fio_option options[FIO_MAX_OPTS] = { .type = FIO_OPT_INT, .off1 = td_var_offset(verify_batch), .help = "Verify this number of IO blocks", - .parent = "verify_backlog", + .parent = "verify", }, #ifdef FIO_HAVE_CPU_AFFINITY { @@ -1468,6 +1478,39 @@ static struct fio_option options[FIO_MAX_OPTS] = { .help = "Set CPUs allowed for async verify threads", .parent = "verify_async", }, +#endif +#ifdef FIO_HAVE_TRIM + { + .name = "trim_percentage", + .type = FIO_OPT_INT, + .cb = str_verify_trim_cb, + .maxval = 100, + .help = "Number of verify blocks to discard/trim", + .parent = "verify", + .def = "0", + }, + { + .name = "trim_verify_zero", + .type = FIO_OPT_INT, + .help = "Verify that trim/discarded blocks are returned as zeroes", + .off1 = td_var_offset(trim_zero), + .parent = "trim_percentage", + .def = "1", + }, + { + .name = "trim_backlog", + .type = FIO_OPT_STR_VAL, + .off1 = td_var_offset(trim_backlog), + .help = "Trim after this number of blocks are written", + .parent = "trim_percentage", + }, + { + .name = "trim_backlog_batch", + .type = FIO_OPT_INT, + .off1 = td_var_offset(trim_batch), + .help = "Trim this number of IO blocks", + .parent = "trim_percentage", + }, #endif { .name = "write_iolog",