X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=42e710715a250e2eca8f2a6a8cd7c609e6571455;hb=f271a3f2d598b9dd8036543071cad573295d8e8e;hp=1f1ceebf33a7d432ad29825a106c5759d0d9bcc8;hpb=2f282cecc27c58ed3aa1204f5bda98433502d7ff;p=fio.git diff --git a/init.c b/init.c index 1f1ceebf..42e71071 100644 --- a/init.c +++ b/init.c @@ -781,6 +781,11 @@ static int fixup_options(struct thread_data *td) o->unit_base = 8; } +#ifndef FIO_HAVE_ANY_FALLOCATE + /* Platform doesn't support any fallocate so force it to none */ + o->fallocate_mode = FIO_FALLOCATE_NONE; +#endif + #ifndef CONFIG_FDATASYNC if (o->fdatasync_blocks) { log_info("fio: this platform does not support fdatasync()" @@ -921,6 +926,12 @@ static void td_fill_rand_seeds_internal(struct thread_data *td, bool use64) { int i; + /* + * trimwrite is special in that we need to generate the same + * offsets to get the "write after trim" effect. If we are + * using bssplit to set buffer length distributions, ensure that + * we seed the trim and write generators identically. + */ if (td_trimwrite(td)) { init_rand_seed(&td->bsrange_state[DDIR_READ], td->rand_seeds[FIO_RAND_BS_OFF], use64); init_rand_seed(&td->bsrange_state[DDIR_WRITE], td->rand_seeds[FIO_RAND_BS1_OFF], use64); @@ -994,16 +1005,24 @@ int ioengine_load(struct thread_data *td) { const char *engine; - /* - * Engine has already been loaded. - */ - if (td->io_ops) - return 0; if (!td->o.ioengine) { log_err("fio: internal fault, no IO engine specified\n"); return 1; } + if (td->io_ops) { + /* An engine is loaded, but the requested ioengine + * may have changed. + */ + if (!strcmp(td->io_ops->name, td->o.ioengine)) { + /* The right engine is already loaded */ + return 0; + } + + /* Unload the old engine. */ + free_ioengine(td); + } + engine = get_engine_name(td->o.ioengine); td->io_ops = load_ioengine(td, engine); if (!td->io_ops) { @@ -2524,7 +2543,6 @@ int parse_cmd_line(int argc, char *argv[], int client_type) } if (!ret && !strcmp(opt, "ioengine")) { - free_ioengine(td); if (ioengine_load(td)) { put_job(td); td = NULL;