Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.26-rc1 /kernel/posix-cpu-timers.c

Filename:/kernel/posix-cpu-timers.c
Lines Added:20
Lines Deleted:21
Also changed in: (Previous) 2.6.25-git20  2.6.25-git19  2.6.25-git18  2.6.25-git17  2.6.25-git16  2.6.25-git15 
(Following) 2.6.26-rc2  2.6.26-rc3  2.6.26-rc4  2.6.26-rc5  2.6.26-rc6  2.6.26-rc7 

Location
[  2.6.26-rc1
  [  kernel
     o  posix-cpu-timers.c

Patch

diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index 2eae91f..f1525ad 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -4,8 +4,9 @@
 
 #include <linux/sched.h>
 #include <linux/posix-timers.h>
-#include <asm/uaccess.h>
 #include <linux/errno.h>
+#include <linux/math64.h>
+#include <asm/uaccess.h>
 
 static int check_clock(const clockid_t which_clock)
 {
@@ -47,12 +48,10 @@ static void sample_to_timespec(const clockid_t which_clock,
                 union cpu_time_count cpu,
                 struct timespec *tp)
 {
-   if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
-      tp->tv_sec = div_long_long_rem(cpu.sched,
-                      NSEC_PER_SEC, &tp->tv_nsec);
-   } else {
+   if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED)
+      *tp = ns_to_timespec(cpu.sched);
+   else
       cputime_to_timespec(cpu.cpu, tp);
-   }
 }
 
 static inline int cpu_time_before(const clockid_t which_clock,
@@ -1087,45 +1086,45 @@ static void check_process_timers(struct task_struct *tsk,
    maxfire = 20;
    prof_expires = cputime_zero;
    while (!list_empty(timers)) {
-      struct cpu_timer_list *t = list_first_entry(timers,
+      struct cpu_timer_list *tl = list_first_entry(timers,
                         struct cpu_timer_list,
                         entry);
-      if (!--maxfire || cputime_lt(ptime, t->expires.cpu)) {
-         prof_expires = t->expires.cpu;
+      if (!--maxfire || cputime_lt(ptime, tl->expires.cpu)) {
+         prof_expires = tl->expires.cpu;
          break;
       }
-      t->firing = 1;
-      list_move_tail(&t->entry, firing);
+      tl->firing = 1;
+      list_move_tail(&tl->entry, firing);
    }
 
    ++timers;
    maxfire = 20;
    virt_expires = cputime_zero;
    while (!list_empty(timers)) {
-      struct cpu_timer_list *t = list_first_entry(timers,
+      struct cpu_timer_list *tl = list_first_entry(timers,
                         struct cpu_timer_list,
                         entry);
-      if (!--maxfire || cputime_lt(utime, t->expires.cpu)) {
-         virt_expires = t->expires.cpu;
+      if (!--maxfire || cputime_lt(utime, tl->expires.cpu)) {
+         virt_expires = tl->expires.cpu;
          break;
       }
-      t->firing = 1;
-      list_move_tail(&t->entry, firing);
+      tl->firing = 1;
+      list_move_tail(&tl->entry, firing);
    }
 
    ++timers;
    maxfire = 20;
    sched_expires = 0;
    while (!list_empty(timers)) {
-      struct cpu_timer_list *t = list_first_entry(timers,
+      struct cpu_timer_list *tl = list_first_entry(timers,
                         struct cpu_timer_list,
                         entry);
-      if (!--maxfire || sum_sched_runtime < t->expires.sched) {
-         sched_expires = t->expires.sched;
+      if (!--maxfire || sum_sched_runtime < tl->expires.sched) {
+         sched_expires = tl->expires.sched;
          break;
       }
-      t->firing = 1;
-      list_move_tail(&t->entry, firing);
+      tl->firing = 1;
+      list_move_tail(&tl->entry, firing);
    }
 
    /*


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.