int temp_stall_ts;
char *fio_inst_prefix = _INST_PREFIX;
-#define should_fsync(td) ((td_write(td) || td_rw(td)) && (!(td)->odirect || (td)->override_sync))
-
static volatile int startup_sem;
#define TERMINATE_ALL (-1)
ret = td_io_getevents(td, min_evts, td->cur_depth, timeout);
if (ret < 0) {
- td_verror(td, -ret);
+ td_verror(td, ret);
break;
} else if (!ret)
continue;
if (td->thinktime)
usec_sleep(td, td->thinktime);
-
- if (should_fsync(td) && td->fsync_blocks &&
- (td->io_blocks[DDIR_WRITE] % td->fsync_blocks) == 0)
- td_io_sync(td, f);
}
if (!ret) {
if (init_random_state(td))
goto err;
- if (td->ioscheduler) {
- int ret = switch_ioscheduler(td);
-
- free(td->ioscheduler);
- free(td->sysfs_root);
- if (ret)
- goto err;
- }
+ if (td->ioscheduler && switch_ioscheduler(td))
+ goto err;
td_set_runstate(td, TD_INITIALIZED);
fio_sem_up(&startup_sem);
gettimeofday(&td->epoch, NULL);
- if (td->exec_prerun) {
+ if (td->exec_prerun)
system(td->exec_prerun);
- free(td->exec_prerun);
- }
while (td->loops--) {
getrusage(RUSAGE_SELF, &td->ru_start);
finish_log(td, td->clat_log, "clat");
if (td->write_iolog)
write_iolog_close(td);
- if (td->exec_postrun) {
+ if (td->exec_postrun)
system(td->exec_postrun);
- free(td->exec_postrun);
- }
if (exitall_on_terminate)
terminate_threads(td->groupid);