提交 5e05ad7d 编写于 作者: D Davide Libenzi 提交者: Linus Torvalds

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: NDavide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ed5d2cac
...@@ -304,6 +304,13 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) ...@@ -304,6 +304,13 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
extern unsigned long extern unsigned long
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); 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: */ /* Precise sleep: */
extern long hrtimer_nanosleep(struct timespec *rqtp, extern long hrtimer_nanosleep(struct timespec *rqtp,
struct timespec *rmtp, struct timespec *rmtp,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册