@@ -562,7 +562,7 @@ static int cpu_timer_sample_group(const clockid_t which_clock,
562562 * and try again. (This happens when the timer is in the middle of firing.)
563563 */
564564static int posix_cpu_timer_set (struct k_itimer * timer , int timer_flags ,
565- struct itimerspec * new , struct itimerspec * old )
565+ struct itimerspec64 * new , struct itimerspec64 * old )
566566{
567567 unsigned long flags ;
568568 struct sighand_struct * sighand ;
@@ -572,7 +572,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
572572
573573 WARN_ON_ONCE (p == NULL );
574574
575- new_expires = timespec_to_ns (& new -> it_value );
575+ new_expires = timespec64_to_ns (& new -> it_value );
576576
577577 /*
578578 * Protect against sighand release/switch in exit/exec and p->cpu_timers
@@ -633,7 +633,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
633633 bump_cpu_timer (timer , val );
634634 if (val < timer -> it .cpu .expires ) {
635635 old_expires = timer -> it .cpu .expires - val ;
636- old -> it_value = ns_to_timespec (old_expires );
636+ old -> it_value = ns_to_timespec64 (old_expires );
637637 } else {
638638 old -> it_value .tv_nsec = 1 ;
639639 old -> it_value .tv_sec = 0 ;
@@ -671,7 +671,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
671671 * Install the new reload setting, and
672672 * set up the signal and overrun bookkeeping.
673673 */
674- timer -> it .cpu .incr = timespec_to_ns (& new -> it_interval );
674+ timer -> it .cpu .incr = timespec64_to_ns (& new -> it_interval );
675675
676676 /*
677677 * This acts as a modification timestamp for the timer,
@@ -695,12 +695,12 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
695695 ret = 0 ;
696696 out :
697697 if (old )
698- old -> it_interval = ns_to_timespec (old_incr );
698+ old -> it_interval = ns_to_timespec64 (old_incr );
699699
700700 return ret ;
701701}
702702
703- static void posix_cpu_timer_get (struct k_itimer * timer , struct itimerspec * itp )
703+ static void posix_cpu_timer_get (struct k_itimer * timer , struct itimerspec64 * itp )
704704{
705705 u64 now ;
706706 struct task_struct * p = timer -> it .cpu .task ;
@@ -710,7 +710,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp)
710710 /*
711711 * Easy part: convert the reload time.
712712 */
713- itp -> it_interval = ns_to_timespec (timer -> it .cpu .incr );
713+ itp -> it_interval = ns_to_timespec64 (timer -> it .cpu .incr );
714714
715715 if (timer -> it .cpu .expires == 0 ) { /* Timer not armed at all. */
716716 itp -> it_value .tv_sec = itp -> it_value .tv_nsec = 0 ;
@@ -739,7 +739,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp)
739739 * Call the timer disarmed, nothing else to do.
740740 */
741741 timer -> it .cpu .expires = 0 ;
742- itp -> it_value = ns_to_timespec (timer -> it .cpu .expires );
742+ itp -> it_value = ns_to_timespec64 (timer -> it .cpu .expires );
743743 return ;
744744 } else {
745745 cpu_timer_sample_group (timer -> it_clock , p , & now );
@@ -748,7 +748,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp)
748748 }
749749
750750 if (now < timer -> it .cpu .expires ) {
751- itp -> it_value = ns_to_timespec (timer -> it .cpu .expires - now );
751+ itp -> it_value = ns_to_timespec64 (timer -> it .cpu .expires - now );
752752 } else {
753753 /*
754754 * The timer should have expired already, but the firing
@@ -1221,6 +1221,7 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
12211221static int do_cpu_nanosleep (const clockid_t which_clock , int flags ,
12221222 struct timespec * rqtp , struct itimerspec * it )
12231223{
1224+ struct itimerspec64 it64 ;
12241225 struct k_itimer timer ;
12251226 int error ;
12261227
@@ -1234,13 +1235,14 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
12341235 error = posix_cpu_timer_create (& timer );
12351236 timer .it_process = current ;
12361237 if (!error ) {
1237- static struct itimerspec zero_it ;
1238+ static struct itimerspec64 zero_it ;
12381239
12391240 memset (it , 0 , sizeof * it );
12401241 it -> it_value = * rqtp ;
12411242
12421243 spin_lock_irq (& timer .it_lock );
1243- error = posix_cpu_timer_set (& timer , flags , it , NULL );
1244+ it64 = itimerspec_to_itimerspec64 (it );
1245+ error = posix_cpu_timer_set (& timer , flags , & it64 , NULL );
12441246 if (error ) {
12451247 spin_unlock_irq (& timer .it_lock );
12461248 return error ;
@@ -1270,7 +1272,9 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
12701272 * We were interrupted by a signal.
12711273 */
12721274 * rqtp = ns_to_timespec (timer .it .cpu .expires );
1273- error = posix_cpu_timer_set (& timer , 0 , & zero_it , it );
1275+ it64 = itimerspec_to_itimerspec64 (it );
1276+ error = posix_cpu_timer_set (& timer , 0 , & zero_it , & it64 );
1277+ * it = itimerspec64_to_itimerspec (& it64 );
12741278 if (!error ) {
12751279 /*
12761280 * Timer is now unarmed, deletion can not fail.
0 commit comments