Skip to content

Commit

Permalink
hrtimer: convert timerfd to the new hrtimer apis
Browse files Browse the repository at this point in the history
In order to be able to do range hrtimers we need to use accessor functions
to the "expire" member of the hrtimer struct.
This patch converts timerfd to these accessors.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
  • Loading branch information
Arjan van de Ven committed Sep 6, 2008
1 parent beb20d5 commit 7636947
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/timerfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr)

static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
{
ktime_t now, remaining;

now = ctx->tmr.base->get_time();
remaining = ktime_sub(ctx->tmr.expires, now);
ktime_t remaining;

remaining = hrtimer_expires_remaining(&ctx->tmr);
return remaining.tv64 < 0 ? ktime_set(0, 0): remaining;
}

Expand All @@ -74,7 +72,7 @@ static void timerfd_setup(struct timerfd_ctx *ctx, int flags,
ctx->ticks = 0;
ctx->tintv = timespec_to_ktime(ktmr->it_interval);
hrtimer_init(&ctx->tmr, ctx->clockid, htmode);
ctx->tmr.expires = texp;
hrtimer_set_expires(&ctx->tmr, texp);
ctx->tmr.function = timerfd_tmrproc;
if (texp.tv64 != 0)
hrtimer_start(&ctx->tmr, texp, htmode);
Expand Down

0 comments on commit 7636947

Please sign in to comment.