Skip to content

Commit

Permalink
timerfd: introduce a new hrtimer_forward_now() function
Browse files Browse the repository at this point in the history
I think that advancing the timer against the timer's current "now" can be a
pretty common usage, so, w/out exposing hrtimer's internals, we add a new
hrtimer_forward_now() function.

Signed-off-by: Davide Libenzi <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
davidel authored and Linus Torvalds committed Feb 5, 2008
1 parent ed5d2ca commit 5e05ad7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/linux/hrtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
extern unsigned long
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);

/* Forward a hrtimer so it expires after the hrtimer's current now */
static inline unsigned long hrtimer_forward_now(struct hrtimer *timer,
ktime_t interval)
{
return hrtimer_forward(timer, timer->base->get_time(), interval);
}

/* Precise sleep: */
extern long hrtimer_nanosleep(struct timespec *rqtp,
struct timespec *rmtp,
Expand Down

0 comments on commit 5e05ad7

Please sign in to comment.