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 long long offset;
unsigned int bytes;
char *str, *p;
- int rw, reads, writes;
+ int reads, writes;
+ 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;
}
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)