TD_INITIALIZED,
TD_RUNNING,
TD_VERIFYING,
+ TD_FSYNCING,
TD_EXITED,
TD_REAPED,
};
struct timeval s, e;
unsigned long usec;
+ td_set_runstate(td, TD_RUNNING);
+
while (td->this_io_bytes[td->ddir] < td->io_size) {
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0};
struct timespec *timeout;
if (td->cur_depth)
cleanup_pending_aio(td);
- if (should_fsync(td) && td->end_fsync)
+ if (should_fsync(td) && td->end_fsync) {
+ td_set_runstate(td, TD_FSYNCING);
sync_td(td);
+ }
}
static void cleanup_io(struct thread_data *td)
return 0;
}
-static void cleanup_allocs(struct thread_data *td)
-{
- if (td->directory)
- free(td->directory);
- if (td->iolog_file)
- free(td->iolog_file);
- if (td->exec_prerun)
- free(td->exec_prerun);
- if (td->exec_postrun)
- free(td->exec_postrun);
- if (td->ioscheduler)
- free(td->ioscheduler);
- if (td->sysfs_root)
- free(td->sysfs_root);
- if (td->file_name)
- free(td->file_name);
-}
-
static int create_file(struct thread_data *td, unsigned long long size,
int extend)
{
}
if (td->odirect)
- flags |= O_DIRECT;
+ flags |= OS_O_DIRECT;
if (td_write(td) || td_rw(td)) {
if (td->filetype == FIO_TYPE_FILE) {
}
if (td->mmap)
munmap(td->mmap, td->file_size);
- cleanup_allocs(td);
cleanup_io(td);
cleanup_io_u(td);
td_set_runstate(td, TD_EXITED);
case TD_VERIFYING:
c = 'V';
break;
+ case TD_FSYNCING:
+ c = 'F';
+ break;
case TD_CREATED:
c = 'C';
break;
eta_sec = INT_MAX;
} else {
/*
- * thread is already done
+ * thread is already done or waiting for fsync
*/
eta_sec = 0;
}
for (i = 0; i < thread_number; i++) {
struct thread_data *td = &threads[i];
- if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING){
+ if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING||
+ td->runstate == TD_FSYNCING) {
nr_running++;
t_rate += td->rate;
m_rate += td->ratemin;