There is nothing hrtimer-specific inside the timerfd_tmrproc(), except the function prototype. We're about to add other timer types, so factor out generic timerfd_expire() helper from timerfd_tmrproc().
Signed-off-by: Anton Vorontsov anton.vorontsov@linaro.org --- fs/timerfd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/timerfd.c b/fs/timerfd.c index ecfb3f3..222db32 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -45,9 +45,8 @@ static DEFINE_SPINLOCK(cancel_lock); * flag, but we do not re-arm the timer (in case it's necessary, * tintv.tv64 != 0) until the timer is accessed. */ -static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) +static void timerfd_expire(struct timerfd_ctx *ctx) { - struct timerfd_ctx *ctx = container_of(htmr, struct timerfd_ctx, tmr); unsigned long flags;
spin_lock_irqsave(&ctx->wqh.lock, flags); @@ -56,6 +55,11 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) wake_up_locked(&ctx->wqh); spin_unlock_irqrestore(&ctx->wqh.lock, flags);
+} + +static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) +{ + timerfd_expire(container_of(htmr, struct timerfd_ctx, tmr)); return HRTIMER_NORESTART; }