semaphore: __down_common: use signal_pending_state()

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

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

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Oleg Nesterov 2008-08-05 13:01:13 -07:00 committed by Linus Torvalds
parent 3219445033
commit 5b2becc8cf

View File

@ -212,9 +212,7 @@ static inline int __sched __down_common(struct semaphore *sem, long state,
waiter.up = 0; waiter.up = 0;
for (;;) { for (;;) {
if (state == TASK_INTERRUPTIBLE && signal_pending(task)) if (signal_pending_state(state, task))
goto interrupted;
if (state == TASK_KILLABLE && fatal_signal_pending(task))
goto interrupted; goto interrupted;
if (timeout <= 0) if (timeout <= 0)
goto timed_out; goto timed_out;