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

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

Advertisement

Kernel v2.6.25-rc7 /kernel/posix-timers.c

Filename:/kernel/posix-timers.c
Lines Added:15
Lines Deleted:23
Also changed in: (Previous) 2.6.25-rc6  2.6.25-rc5  2.6.25-rc4  2.6.25-rc3  2.6.25-rc2  2.6.25-rc1-git4 
(Following) 2.6.25-rc8  2.6.25-rc9  2.6.25  2.6.25-git3  2.6.25-git4  2.6.25-git5 

Location
[  2.6.25-rc7
  [  kernel
     o  posix-timers.c

Patch

diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 35b4bbf..a9b0420 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -256,8 +256,9 @@ static void schedule_next_timer(struct k_itimer *timr)
    if (timr->it.real.interval.tv64 == 0)
       return;
 
-   timr->it_overrun += hrtimer_forward(timer, timer->base->get_time(),
-                   timr->it.real.interval);
+   timr->it_overrun += (unsigned int) hrtimer_forward(timer,
+                  timer->base->get_time(),
+                  timr->it.real.interval);
 
    timr->it_overrun_last = timr->it_overrun;
    timr->it_overrun = -1;
@@ -386,7 +387,7 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
                now = ktime_add(now, kj);
          }
 #endif
-         timr->it_overrun +=
+         timr->it_overrun += (unsigned int)
             hrtimer_forward(timer, now,
                   timr->it.real.interval);
          ret = HRTIMER_RESTART;
@@ -403,7 +404,7 @@ static struct task_struct * good_sigevent(sigevent_t * event)
    struct task_struct *rtn = current->group_leader;
 
    if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
-      (!(rtn = find_task_by_pid(event->sigev_notify_thread_id)) ||
+      (!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) ||
        !same_thread_group(rtn, current) ||
        (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
       return NULL;
@@ -493,7 +494,7 @@ sys_timer_create(const clockid_t which_clock,
       goto retry;
    else if (error) {
       /*
-       * Wierd looking, but we return EAGAIN if the IDR is
+       * Weird looking, but we return EAGAIN if the IDR is
        * full (proper POSIX return value for this)
        */
       error = -EAGAIN;
@@ -662,7 +663,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
     */
    if (iv.tv64 && (timr->it_requeue_pending & REQUEUE_PENDING ||
        (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
-      timr->it_overrun += hrtimer_forward(timer, now, iv);
+      timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
 
    remaining = ktime_sub(timer->expires, now);
    /* Return 0 only, when the timer is expired and not pending */
@@ -766,9 +767,11 @@ common_timer_set(struct k_itimer *timr, int flags,
    /* SIGEV_NONE timers are not queued ! See common_timer_get */
    if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
       /* Setup correct expiry time for relative timers */
-      if (mode == HRTIMER_MODE_REL)
-         timer->expires = ktime_add(timer->expires,
-                     timer->base->get_time());
+      if (mode == HRTIMER_MODE_REL) {
+         timer->expires =
+            ktime_add_safe(timer->expires,
+                      timer->base->get_time());
+      }
       return 0;
    }
 
@@ -981,20 +984,9 @@ sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp)
 static int common_nsleep(const clockid_t which_clock, int flags,
           struct timespec *tsave, struct timespec __user *rmtp)
 {
-   struct timespec rmt;
-   int ret;
-
-   ret = hrtimer_nanosleep(tsave, rmtp ? &rmt : NULL,
-            flags & TIMER_ABSTIME ?
-            HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
-            which_clock);
-
-   if (ret && rmtp) {
-      if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
-         return -EFAULT;
-   }
-
-   return ret;
+   return hrtimer_nanosleep(tsave, rmtp, flags & TIMER_ABSTIME ?
+             HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
+             which_clock);
 }
 
 asmlinkage long


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