mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
timerfd: introduce a new hrtimer_forward_now() function
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]>
This commit is contained in:
parent
ed5d2cac11
commit
5e05ad7d4e
1 changed files with 7 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue