Fix bug with rwmix and multiple loops over the same set

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.c b/fio.c
index bdf9fd1..6ac8ef0 100644
--- a/fio.c
+++ b/fio.c
@@ -880,7 +880,6 @@
 	td->zone_bytes = 0;
 	td->rate_bytes = 0;
 	td->rate_blocks = 0;
-	td->rw_end_set[0] = td->rw_end_set[1] = 0;
 
 	td->last_was_sync = 0;
 
@@ -1065,21 +1064,11 @@
 		clear_state = 1;
 
 		if (td_read(td) && td->io_bytes[DDIR_READ]) {
-			if (td->rw_end_set[DDIR_READ])
-				elapsed = utime_since(&td->start,
-						      &td->rw_end[DDIR_READ]);
-			else
-				elapsed = utime_since_now(&td->start);
-
+			elapsed = utime_since_now(&td->start);
 			runtime[DDIR_READ] += elapsed;
 		}
 		if (td_write(td) && td->io_bytes[DDIR_WRITE]) {
-			if (td->rw_end_set[DDIR_WRITE])
-				elapsed = utime_since(&td->start,
-						      &td->rw_end[DDIR_WRITE]);
-			else
-				elapsed = utime_since_now(&td->start);
-
+			elapsed = utime_since_now(&td->start);
 			runtime[DDIR_WRITE] += elapsed;
 		}
 
diff --git a/fio.h b/fio.h
index b2e40d2..0a72819 100644
--- a/fio.h
+++ b/fio.h
@@ -332,12 +332,10 @@
 
 	struct timeval start;	/* start of this loop */
 	struct timeval epoch;	/* time job was started */
-	struct timeval rw_end[2];
 	struct timeval last_issue;
 	struct timeval tv_cache;
 	unsigned int tv_cache_nr;
 	unsigned int tv_cache_mask;
-	unsigned int rw_end_set[2];
 	unsigned int ramp_time_over;
 
 	/*
diff --git a/io_u.c b/io_u.c
index 5cf2526..40fd196 100644
--- a/io_u.c
+++ b/io_u.c
@@ -319,7 +319,6 @@
 		 * Check if it's time to seed a new data direction.
 		 */
 		if (td->io_issues[td->rwmix_ddir] >= td->rwmix_issues) {
-			unsigned long long max_bytes;
 			enum fio_ddir ddir;
 
 			/*
@@ -328,16 +327,6 @@
 			 * ranges too much
 			 */
 			ddir = get_rand_ddir(td);
-			max_bytes = td->this_io_bytes[ddir];
-			if (max_bytes >=
-			    (td->o.size * td->o.rwmix[ddir] / 100)) {
-				if (!td->rw_end_set[ddir]) {
-					td->rw_end_set[ddir] = 1;
-					fio_gettime(&td->rw_end[ddir], NULL);
-				}
-
-				ddir ^= 1;
-			}
 
 			if (ddir != td->rwmix_ddir)
 				set_rwmix_bytes(td);