#include "fio.h"
#include "hash.h"
+#include "smalloc.h"
unsigned long page_mask;
unsigned long page_size;
static inline void td_set_runstate(struct thread_data *td, int runstate)
{
+ if (td->runstate == runstate)
+ return;
+
dprint(FD_PROCESS, "pid=%d: runstate %d -> %d\n", td->pid, td->runstate,
runstate);
td->runstate = runstate;
* Add verification end_io handler, if asked to verify
* a previously written file.
*/
- if (td->o.verify != VERIFY_NONE)
+ if (td->o.verify != VERIFY_NONE && io_u->ddir == DDIR_READ) {
io_u->end_io = verify_io_u;
+ td_set_runstate(td, TD_VERIFYING);
+ } else
+ td_set_runstate(td, TD_RUNNING);
ret = td_io_queue(td, io_u);
switch (ret) {
log_err("fio: pid=%d, err=%d/%s\n", td->pid, td->error, td->verror);
td_set_runstate(td, TD_REAPED);
todo--;
- }
+ } else {
+ struct fio_file *f;
+ unsigned int i;
+
+ /*
+ * for sharing to work, each job must always open
+ * its own files. so close them, if we opened them
+ * for creation
+ */
+ for_each_file(td, f, i)
+ td_io_close_file(td, f);
+ }
init_disk_util(td);
}
{
long ps;
+ sinit();
+
/*
* We need locale for number printing, if it isn't set then just
* go with the US format.