From 2e1f3c8dca9fdb0d69c4c0bbdd5dda1d3785ea27 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Fri, 1 Oct 2010 21:16:38 +0200 Subject: [PATCH] --- yaml --- r: 213065 b: refs/heads/master c: 5e901a2b95db709c5e40599ff4df6029be1e2a12 h: refs/heads/master i: 213063: e66dc18835141b672f0355e00b1504c89ff0cc96 v: v3 --- [refs] | 2 +- trunk/block/blk-throttle.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index e8238e9d7e8e..0f376eb77d30 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3aad5d3ee4e4fce8f4b5bb6ca73342dcade42b33 +refs/heads/master: 5e901a2b95db709c5e40599ff4df6029be1e2a12 diff --git a/trunk/block/blk-throttle.c b/trunk/block/blk-throttle.c index a46700255719..c1bc1b6c887a 100644 --- a/trunk/block/blk-throttle.c +++ b/trunk/block/blk-throttle.c @@ -439,8 +439,7 @@ static bool tg_with_in_iops_limit(struct throtl_data *td, struct throtl_grp *tg, jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice); - io_allowed = (tg->iops[rw] * jiffies_to_msecs(jiffy_elapsed_rnd)) - / MSEC_PER_SEC; + io_allowed = (tg->iops[rw] * jiffy_elapsed_rnd) / HZ; if (tg->io_disp[rw] + 1 <= io_allowed) { if (wait) @@ -476,8 +475,8 @@ static bool tg_with_in_bps_limit(struct throtl_data *td, struct throtl_grp *tg, jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice); - tmp = tg->bps[rw] * jiffies_to_msecs(jiffy_elapsed_rnd); - do_div(tmp, MSEC_PER_SEC); + tmp = tg->bps[rw] * jiffy_elapsed_rnd; + do_div(tmp, HZ); bytes_allowed = tmp; if (tg->bytes_disp[rw] + bio->bi_size <= bytes_allowed) {