return 0;
}
+ td->done = 1;
return 1;
}
if (rw == DDIR_READ)
reads++;
- else if (rw == DDIR_WRITE)
+ else if (rw == DDIR_WRITE) {
writes++;
- else if (rw != DDIR_SYNC && rw != DDIR_INVAL) {
+ /*
+ * Don't add a write for ro mode
+ */
+ if (read_only)
+ continue;
+ } else if (rw != DDIR_SYNC && rw != DDIR_INVAL) {
log_err("bad ddir: %d\n", rw);
continue;
}
ipo->file_action = file_action;
}
list_add_tail(&ipo->list, &td->io_log_list);
+ td->total_io_size += bytes;
}
free(str);
free(act);
free(fname);
+ if (writes && read_only) {
+ log_err("fio: <%s> skips replay of %d writes due to read-only\n", td->o.name, writes);
+ writes = 0;
+ }
+
if (!reads && !writes)
return 1;
else if (reads && !writes)
unsigned int bytes;
char *str, *p;
int reads, writes;
- enum fio_ddir rw;
+ int rw;
/*
* Read in the read iolog and store it, reuse the infrastructure
}
if (rw == DDIR_READ)
reads++;
- else if (rw == DDIR_WRITE)
+ else if (rw == DDIR_WRITE) {
writes++;
- else if (rw != DDIR_SYNC) {
+ /*
+ * Don't add a write for ro mode
+ */
+ if (read_only)
+ continue;
+ } else if (rw != DDIR_SYNC) {
log_err("bad ddir: %d\n", rw);
continue;
}
INIT_LIST_HEAD(&ipo->list);
ipo->offset = offset;
ipo->len = bytes;
- ipo->ddir = rw;
+ ipo->ddir = (enum fio_ddir) rw;
if (bytes > td->o.max_bs[rw])
td->o.max_bs[rw] = bytes;
list_add_tail(&ipo->list, &td->io_log_list);
+ td->total_io_size += bytes;
}
free(str);
+ if (writes && read_only) {
+ log_err("fio: <%s> skips replay of %d writes due to read-only\n", td->o.name, writes);
+ writes = 0;
+ }
+
if (!reads && !writes)
return 1;
else if (reads && !writes)