Yet another rate fixup
authorJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jun 2009 20:06:23 +0000 (22:06 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jun 2009 20:06:23 +0000 (22:06 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index bac65739a1ad05843561e2f7dfca1e389265b769..34ab58a11ddc83066d410cc6db71fe7ff8bcff8a 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -970,10 +970,12 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                        }
                        if (!td->o.disable_bw)
                                add_bw_sample(td, idx, bytes, &icd->time);
                        }
                        if (!td->o.disable_bw)
                                add_bw_sample(td, idx, bytes, &icd->time);
-                       if (__should_check_rate(td, idx))
-                               td->rate_pending_usleep[idx] += (long) td->rate_usec_cycle[idx] - rusec;
+                       if (__should_check_rate(td, idx)) {
+                               td->rate_pending_usleep[idx] +=
+                                       (long) td->rate_usec_cycle[idx] - rusec;
+                       }
                        if (__should_check_rate(td, idx ^ 1))
                        if (__should_check_rate(td, idx ^ 1))
-                               td->rate_pending_usleep[idx ^ 1] -= lusec;
+                               td->rate_pending_usleep[idx ^ 1] -= rusec;
                }
 
                if (td_write(td) && idx == DDIR_WRITE &&
                }
 
                if (td_write(td) && idx == DDIR_WRITE &&