[PATCH] __down_common: use signal_pending_state()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Thursday, July 24, 2008 - 9:35 am

Change __down_common() to use signal_pending_state() instead of open
coding.

The changes in kernel/semaphore.o are just artefacts, the state checks
are optimized away.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 26-rc2/kernel/semaphore.c~2_SPS_DOWN	2008-06-08 17:25:01.000000000 +0400
+++ 26-rc2/kernel/semaphore.c	2008-07-24 20:17:47.000000000 +0400
@@ -211,9 +211,7 @@ static inline int __sched __down_common(
 	waiter.up = 0;
 
 	for (;;) {
-		if (state == TASK_INTERRUPTIBLE && signal_pending(task))
-			goto interrupted;
-		if (state == TASK_KILLABLE && fatal_signal_pending(task))
+		if (signal_pending_state(state, task))
 			goto interrupted;
 		if (timeout <= 0)
 			goto timed_out;

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] __down_common: use signal_pending_state(), Oleg Nesterov, (Thu Jul 24, 9:35 am)