Skip to content

Commit 7250a40

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
posix-timers: Unify MONOTONIC and BOOTTIME clock behavior
Now that the MONOTONIC and BOOTTIME clocks are indentical remove all the special casing. The user space visible interfaces still support both clocks, but their behavior is identical. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kevin Easton <kevin@guarana.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20180301165150.315745557@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent d6c7270 commit 7250a40

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

kernel/time/posix-timers.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,6 @@ static int posix_get_coarse_res(const clockid_t which_clock, struct timespec64 *
251251
return 0;
252252
}
253253

254-
static int posix_get_boottime(const clockid_t which_clock, struct timespec64 *tp)
255-
{
256-
get_monotonic_boottime64(tp);
257-
return 0;
258-
}
259-
260254
static int posix_get_tai(clockid_t which_clock, struct timespec64 *tp)
261255
{
262256
timekeeping_clocktai64(tp);
@@ -1322,21 +1316,6 @@ static const struct k_clock clock_tai = {
13221316
.timer_arm = common_hrtimer_arm,
13231317
};
13241318

1325-
static const struct k_clock clock_boottime = {
1326-
.clock_getres = posix_get_hrtimer_res,
1327-
.clock_get = posix_get_boottime,
1328-
.nsleep = common_nsleep,
1329-
.timer_create = common_timer_create,
1330-
.timer_set = common_timer_set,
1331-
.timer_get = common_timer_get,
1332-
.timer_del = common_timer_del,
1333-
.timer_rearm = common_hrtimer_rearm,
1334-
.timer_forward = common_hrtimer_forward,
1335-
.timer_remaining = common_hrtimer_remaining,
1336-
.timer_try_to_cancel = common_hrtimer_try_to_cancel,
1337-
.timer_arm = common_hrtimer_arm,
1338-
};
1339-
13401319
static const struct k_clock clock_monotonic_active = {
13411320
.clock_getres = posix_get_hrtimer_res,
13421321
.clock_get = posix_get_monotonic_active,
@@ -1350,7 +1329,7 @@ static const struct k_clock * const posix_clocks[] = {
13501329
[CLOCK_MONOTONIC_RAW] = &clock_monotonic_raw,
13511330
[CLOCK_REALTIME_COARSE] = &clock_realtime_coarse,
13521331
[CLOCK_MONOTONIC_COARSE] = &clock_monotonic_coarse,
1353-
[CLOCK_BOOTTIME] = &clock_boottime,
1332+
[CLOCK_BOOTTIME] = &clock_monotonic,
13541333
[CLOCK_REALTIME_ALARM] = &alarm_clock,
13551334
[CLOCK_BOOTTIME_ALARM] = &alarm_clock,
13561335
[CLOCK_TAI] = &clock_tai,

0 commit comments

Comments
 (0)