pkt_sched: Rename PSCHED_US2NS and PSCHED_NS2US

Let's use TICKS instead of US, so PSCHED_TICKS2NS and PSCHED_NS2TICKS
(like in PSCHED_TICKS_PER_SEC already) to avoid misleading.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jarek Poplawski 2009-06-15 02:31:47 -07:00 committed by David S. Miller
parent e0f7cb8c8c
commit ca44d6e60f
3 changed files with 8 additions and 8 deletions

View file

@ -43,15 +43,15 @@ typedef long psched_tdiff_t;
/* Avoid doing 64 bit divide */ /* Avoid doing 64 bit divide */
#define PSCHED_SHIFT 6 #define PSCHED_SHIFT 6
#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT) #define PSCHED_TICKS2NS(x) ((s64)(x) << PSCHED_SHIFT)
#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT) #define PSCHED_NS2TICKS(x) ((x) >> PSCHED_SHIFT)
#define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC) #define PSCHED_TICKS_PER_SEC PSCHED_NS2TICKS(NSEC_PER_SEC)
#define PSCHED_PASTPERFECT 0 #define PSCHED_PASTPERFECT 0
static inline psched_time_t psched_get_time(void) static inline psched_time_t psched_get_time(void)
{ {
return PSCHED_NS2US(ktime_to_ns(ktime_get())); return PSCHED_NS2TICKS(ktime_to_ns(ktime_get()));
} }
static inline psched_tdiff_t static inline psched_tdiff_t

View file

@ -484,7 +484,7 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
wd->qdisc->flags |= TCQ_F_THROTTLED; wd->qdisc->flags |= TCQ_F_THROTTLED;
time = ktime_set(0, 0); time = ktime_set(0, 0);
time = ktime_add_ns(time, PSCHED_US2NS(expires)); time = ktime_add_ns(time, PSCHED_TICKS2NS(expires));
hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
} }
EXPORT_SYMBOL(qdisc_watchdog_schedule); EXPORT_SYMBOL(qdisc_watchdog_schedule);
@ -1680,7 +1680,7 @@ static int psched_show(struct seq_file *seq, void *v)
hrtimer_get_res(CLOCK_MONOTONIC, &ts); hrtimer_get_res(CLOCK_MONOTONIC, &ts);
seq_printf(seq, "%08x %08x %08x %08x\n", seq_printf(seq, "%08x %08x %08x %08x\n",
(u32)NSEC_PER_USEC, (u32)PSCHED_US2NS(1), (u32)NSEC_PER_USEC, (u32)PSCHED_TICKS2NS(1),
1000000, 1000000,
(u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts))); (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts)));

View file

@ -509,7 +509,7 @@ static void cbq_ovl_delay(struct cbq_class *cl)
q->pmask |= (1<<TC_CBQ_MAXPRIO); q->pmask |= (1<<TC_CBQ_MAXPRIO);
expires = ktime_set(0, 0); expires = ktime_set(0, 0);
expires = ktime_add_ns(expires, PSCHED_US2NS(sched)); expires = ktime_add_ns(expires, PSCHED_TICKS2NS(sched));
if (hrtimer_try_to_cancel(&q->delay_timer) && if (hrtimer_try_to_cancel(&q->delay_timer) &&
ktime_to_ns(ktime_sub( ktime_to_ns(ktime_sub(
hrtimer_get_expires(&q->delay_timer), hrtimer_get_expires(&q->delay_timer),
@ -620,7 +620,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
ktime_t time; ktime_t time;
time = ktime_set(0, 0); time = ktime_set(0, 0);
time = ktime_add_ns(time, PSCHED_US2NS(now + delay)); time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay));
hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS);
} }