block: add blk_time_get_ns() and blk_time_get() helpers
[linux-2.6-block.git] / block / blk-throttle.c
index 16f5766620a41043645756c51d441f4488af9edf..da9dc1f793c3b71a96a1e09e759adf39e91c71cb 100644 (file)
@@ -1815,7 +1815,7 @@ static bool throtl_tg_is_idle(struct throtl_grp *tg)
        time = min_t(unsigned long, MAX_IDLE_TIME, 4 * tg->idletime_threshold);
        ret = tg->latency_target == DFL_LATENCY_TARGET ||
              tg->idletime_threshold == DFL_IDLE_THRESHOLD ||
-             (ktime_get_ns() >> 10) - tg->last_finish_time > time ||
+             (blk_time_get_ns() >> 10) - tg->last_finish_time > time ||
              tg->avg_idletime > tg->idletime_threshold ||
              (tg->latency_target && tg->bio_cnt &&
                tg->bad_bio_cnt * 5 < tg->bio_cnt);
@@ -2060,7 +2060,7 @@ static void blk_throtl_update_idletime(struct throtl_grp *tg)
        if (last_finish_time == 0)
                return;
 
-       now = ktime_get_ns() >> 10;
+       now = blk_time_get_ns() >> 10;
        if (now <= last_finish_time ||
            last_finish_time == tg->checked_last_finish_time)
                return;
@@ -2327,7 +2327,7 @@ void blk_throtl_bio_endio(struct bio *bio)
        if (!tg->td->limit_valid[LIMIT_LOW])
                return;
 
-       finish_time_ns = ktime_get_ns();
+       finish_time_ns = blk_time_get_ns();
        tg->last_finish_time = finish_time_ns >> 10;
 
        start_time = bio_issue_time(&bio->bi_issue) >> 10;