timekeeping:Introduce the timekeeping_clocktai() function with timespec64 type
PATCH v4 17/25 timekeeping:Introduce the timekeeping_clocktai() function with timespec64 type
This patch converts the timespec type to timespec64 type for timekeeping_clocktai() function which is used only in the posix-timers.c file, that makes it ready for 2038 issue.
And remove the declaration of timekeeping_clocktai() in kernel/time/timekeeping.h file, cause nothing uses that declaration now, and it would conflict with the inline definition in the include/linux/timekeeping.h file.
Also introduce the clock_get64 callback pointer for the k_clock structure, and convert the timespec type to timespec64 type for the posix_get_tai() function.
Next patch will convert all the timespec/itimerspec to the timespec64/itimerspec64 type for other callbacks of the k_clock structure in the kernel/time/posix-timers.c file.
--- include/linux/timekeeping.h | 4 ++-- kernel/time/posix-timers.c | 4 ++-- kernel/time/timekeeping.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-)
include/linux/timekeeping.h +2 -2
@@ -250,9 +250,9 @@ static inline void get_monotonic_boottime64(struct timespec64 *ts) *ts =ktime_to_timespec64 (ktime_get_boottime ()); } -static inline void timekeeping_clocktai (struct timespec *ts) +static inline void timekeeping_clocktai (struct timespec64 *ts) { - *ts =ktime_to_timespec (ktime_get_clocktai ()); + *ts =ktime_to_timespec64 (ktime_get_clocktai ()); }/*
kernel/time/posix-timers.c +2 -2
@@ -296,7 +296,7 @@ static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp)return 0 ; } -static int posix_get_tai (clockid_t which_clock,struct timespec *tp) +static int posix_get_tai (clockid_t which_clock,struct timespec64 *tp) {timekeeping_clocktai (tp);return 0 ;
@@ -343,7 +343,7 @@ static __init int init_posix_timers(void) };struct k_clock clock_tai = { .clock_getres = hrtimer_get_res, - .clock_get = posix_get_tai, + .clock_get64 = posix_get_tai, .nsleep = common_nsleep, .nsleep_restart = hrtimer_nanosleep_restart, .timer_create = common_timer_create,
kernel/time/timekeeping.h +0 -1
@@ -15,7 +15,6 @@ extern u64 timekeeping_max_deferment(void);extern int timekeeping_inject_offset (struct timespec *ts);extern s32 timekeeping_get_tai_offset (void );extern void timekeeping_set_tai_offset (s32 tai_offset); -extern void timekeeping_clocktai (struct timespec *ts);extern int timekeeping_suspend (void );extern void timekeeping_resume (void );
Signature · 1 line
1.7.9.5
Quoted 1 line · Baolin Wang
Subject: timekeeping:Introduce the
timekeeping_clocktai()function with timespec64 type
You are not introducing anything new. You change the implementation.
Quoted 4 lines
This patch converts the timespec type to timespec64 type for
timekeeping_clocktai()function which is used only in theposix-timers.cfile, that makes it ready for 2038 issue.
Quoted 8 lines
And remove the declaration of
timekeeping_clocktai()inkernel/time/timekeeping.hfile, cause nothing uses that declaration now, and it would conflict with the inline definition in theinclude/linux/timekeeping.hfile.Also introduce the
clock_get64callback pointer for thek_clockstructure, and convert the timespec type to timespec64 type for theposix_get_tai()function.
Stop explaining WHAT your patches are doing.
Thanks,
tglx