diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 17:04:23 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 13:18:02 -0400 |
commit | 53cc7bad37fcb90e47ef729ef9818a2ed93ee862 (patch) | |
tree | 985df79b743216cd12f1820e4dc94e8b6497cc3e /fs/timerfd.c | |
parent | 9a6b51976ea3a326b6de534beec3fd87275f4ef6 (diff) |
timerfd: Use ktime_mono_to_real()
We have a few other use cases of ktime_get_monotonic_offset() which
can be optimized with ktime_mono_to_real(). The timerfd code uses the
offset only for comparison, so we can use ktime_mono_to_real(0) for
this as well.
Funny enough text size shrinks with that on ARM and x8664 !?
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'fs/timerfd.c')
-rw-r--r-- | fs/timerfd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c index 709603cac9e6..80c350216ea8 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c | |||
@@ -93,7 +93,7 @@ static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm, | |||
93 | */ | 93 | */ |
94 | void timerfd_clock_was_set(void) | 94 | void timerfd_clock_was_set(void) |
95 | { | 95 | { |
96 | ktime_t moffs = ktime_get_monotonic_offset(); | 96 | ktime_t moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); |
97 | struct timerfd_ctx *ctx; | 97 | struct timerfd_ctx *ctx; |
98 | unsigned long flags; | 98 | unsigned long flags; |
99 | 99 | ||
@@ -126,7 +126,7 @@ static bool timerfd_canceled(struct timerfd_ctx *ctx) | |||
126 | { | 126 | { |
127 | if (!ctx->might_cancel || ctx->moffs.tv64 != KTIME_MAX) | 127 | if (!ctx->might_cancel || ctx->moffs.tv64 != KTIME_MAX) |
128 | return false; | 128 | return false; |
129 | ctx->moffs = ktime_get_monotonic_offset(); | 129 | ctx->moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); |
130 | return true; | 130 | return true; |
131 | } | 131 | } |
132 | 132 | ||
@@ -405,7 +405,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) | |||
405 | else | 405 | else |
406 | hrtimer_init(&ctx->t.tmr, clockid, HRTIMER_MODE_ABS); | 406 | hrtimer_init(&ctx->t.tmr, clockid, HRTIMER_MODE_ABS); |
407 | 407 | ||
408 | ctx->moffs = ktime_get_monotonic_offset(); | 408 | ctx->moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); |
409 | 409 | ||
410 | ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, | 410 | ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, |
411 | O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS)); | 411 | O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS)); |