diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-10-30 18:02:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:20 -0500 |
commit | 4eb9af2a8a431a832830f986fead7332dab27229 (patch) | |
tree | 424d265f46c7d2e545235117e1b5dcfb074b5228 | |
parent | 33430dc593f866f5d67ff6a6213b6dd6d7ea3ce1 (diff) |
[PATCH] posix-timers: use schedule_timeout() in common_nsleep()
common_nsleep() reimplements schedule_timeout_interruptible() for unknown
reason.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/posix-timers.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index dda3cda73c77..ea55c7a1cd75 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -1295,13 +1295,6 @@ sys_clock_getres(clockid_t which_clock, struct timespec __user *tp) | |||
1295 | return error; | 1295 | return error; |
1296 | } | 1296 | } |
1297 | 1297 | ||
1298 | static void nanosleep_wake_up(unsigned long __data) | ||
1299 | { | ||
1300 | struct task_struct *p = (struct task_struct *) __data; | ||
1301 | |||
1302 | wake_up_process(p); | ||
1303 | } | ||
1304 | |||
1305 | /* | 1298 | /* |
1306 | * The standard says that an absolute nanosleep call MUST wake up at | 1299 | * The standard says that an absolute nanosleep call MUST wake up at |
1307 | * the requested time in spite of clock settings. Here is what we do: | 1300 | * the requested time in spite of clock settings. Here is what we do: |
@@ -1442,7 +1435,6 @@ static int common_nsleep(clockid_t which_clock, | |||
1442 | int flags, struct timespec *tsave) | 1435 | int flags, struct timespec *tsave) |
1443 | { | 1436 | { |
1444 | struct timespec t, dum; | 1437 | struct timespec t, dum; |
1445 | struct timer_list new_timer; | ||
1446 | DECLARE_WAITQUEUE(abs_wqueue, current); | 1438 | DECLARE_WAITQUEUE(abs_wqueue, current); |
1447 | u64 rq_time = (u64)0; | 1439 | u64 rq_time = (u64)0; |
1448 | s64 left; | 1440 | s64 left; |
@@ -1451,10 +1443,6 @@ static int common_nsleep(clockid_t which_clock, | |||
1451 | ¤t_thread_info()->restart_block; | 1443 | ¤t_thread_info()->restart_block; |
1452 | 1444 | ||
1453 | abs_wqueue.flags = 0; | 1445 | abs_wqueue.flags = 0; |
1454 | init_timer(&new_timer); | ||
1455 | new_timer.expires = 0; | ||
1456 | new_timer.data = (unsigned long) current; | ||
1457 | new_timer.function = nanosleep_wake_up; | ||
1458 | abs = flags & TIMER_ABSTIME; | 1446 | abs = flags & TIMER_ABSTIME; |
1459 | 1447 | ||
1460 | if (restart_block->fn == clock_nanosleep_restart) { | 1448 | if (restart_block->fn == clock_nanosleep_restart) { |
@@ -1490,13 +1478,8 @@ static int common_nsleep(clockid_t which_clock, | |||
1490 | if (left < (s64)0) | 1478 | if (left < (s64)0) |
1491 | break; | 1479 | break; |
1492 | 1480 | ||
1493 | new_timer.expires = jiffies + left; | 1481 | schedule_timeout_interruptible(left); |
1494 | __set_current_state(TASK_INTERRUPTIBLE); | ||
1495 | add_timer(&new_timer); | ||
1496 | |||
1497 | schedule(); | ||
1498 | 1482 | ||
1499 | del_timer_sync(&new_timer); | ||
1500 | left = rq_time - get_jiffies_64(); | 1483 | left = rq_time - get_jiffies_64(); |
1501 | } while (left > (s64)0 && !test_thread_flag(TIF_SIGPENDING)); | 1484 | } while (left > (s64)0 && !test_thread_flag(TIF_SIGPENDING)); |
1502 | 1485 | ||