[PATCH 3/4] timerfd: Factor out timer-type unspecific timerfd_expire()

From: Anton Vorontsov
Date: Sun Sep 02 2012 - 01:48:42 EST


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@xxxxxxxxxx>
---
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;
}

--
1.7.11.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/