diff options
| -rw-r--r-- | include/linux/posix-timers.h | 2 | ||||
| -rw-r--r-- | kernel/time/posix-cpu-timers.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index e96581ca7c9d..b20798fc5191 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
| @@ -12,7 +12,7 @@ struct siginfo; | |||
| 12 | 12 | ||
| 13 | struct cpu_timer_list { | 13 | struct cpu_timer_list { |
| 14 | struct list_head entry; | 14 | struct list_head entry; |
| 15 | u64 expires, incr; | 15 | u64 expires; |
| 16 | struct task_struct *task; | 16 | struct task_struct *task; |
| 17 | int firing; | 17 | int firing; |
| 18 | }; | 18 | }; |
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 80f955210861..0a426f4e3125 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c | |||
| @@ -67,13 +67,13 @@ static void bump_cpu_timer(struct k_itimer *timer, u64 now) | |||
| 67 | int i; | 67 | int i; |
| 68 | u64 delta, incr; | 68 | u64 delta, incr; |
| 69 | 69 | ||
| 70 | if (timer->it.cpu.incr == 0) | 70 | if (!timer->it_interval) |
| 71 | return; | 71 | return; |
| 72 | 72 | ||
| 73 | if (now < timer->it.cpu.expires) | 73 | if (now < timer->it.cpu.expires) |
| 74 | return; | 74 | return; |
| 75 | 75 | ||
| 76 | incr = timer->it.cpu.incr; | 76 | incr = timer->it_interval; |
| 77 | delta = now + incr - timer->it.cpu.expires; | 77 | delta = now + incr - timer->it.cpu.expires; |
| 78 | 78 | ||
| 79 | /* Don't use (incr*2 < delta), incr*2 might overflow. */ | 79 | /* Don't use (incr*2 < delta), incr*2 might overflow. */ |
| @@ -520,7 +520,7 @@ static void cpu_timer_fire(struct k_itimer *timer) | |||
| 520 | */ | 520 | */ |
| 521 | wake_up_process(timer->it_process); | 521 | wake_up_process(timer->it_process); |
| 522 | timer->it.cpu.expires = 0; | 522 | timer->it.cpu.expires = 0; |
| 523 | } else if (timer->it.cpu.incr == 0) { | 523 | } else if (!timer->it_interval) { |
| 524 | /* | 524 | /* |
| 525 | * One-shot timer. Clear it as soon as it's fired. | 525 | * One-shot timer. Clear it as soon as it's fired. |
| 526 | */ | 526 | */ |
| @@ -606,7 +606,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, | |||
| 606 | */ | 606 | */ |
| 607 | 607 | ||
| 608 | ret = 0; | 608 | ret = 0; |
| 609 | old_incr = timer->it.cpu.incr; | 609 | old_incr = timer->it_interval; |
| 610 | old_expires = timer->it.cpu.expires; | 610 | old_expires = timer->it.cpu.expires; |
| 611 | if (unlikely(timer->it.cpu.firing)) { | 611 | if (unlikely(timer->it.cpu.firing)) { |
| 612 | timer->it.cpu.firing = -1; | 612 | timer->it.cpu.firing = -1; |
| @@ -684,8 +684,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, | |||
| 684 | * Install the new reload setting, and | 684 | * Install the new reload setting, and |
| 685 | * set up the signal and overrun bookkeeping. | 685 | * set up the signal and overrun bookkeeping. |
| 686 | */ | 686 | */ |
| 687 | timer->it.cpu.incr = timespec64_to_ns(&new->it_interval); | 687 | timer->it_interval = timespec64_to_ktime(new->it_interval); |
| 688 | timer->it_interval = ns_to_ktime(timer->it.cpu.incr); | ||
| 689 | 688 | ||
| 690 | /* | 689 | /* |
| 691 | * This acts as a modification timestamp for the timer, | 690 | * This acts as a modification timestamp for the timer, |
| @@ -724,7 +723,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec64 *itp | |||
| 724 | /* | 723 | /* |
| 725 | * Easy part: convert the reload time. | 724 | * Easy part: convert the reload time. |
| 726 | */ | 725 | */ |
| 727 | itp->it_interval = ns_to_timespec64(timer->it.cpu.incr); | 726 | itp->it_interval = ktime_to_timespec64(timer->it_interval); |
| 728 | 727 | ||
| 729 | if (!timer->it.cpu.expires) | 728 | if (!timer->it.cpu.expires) |
| 730 | return; | 729 | return; |
