]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
__mutex_lock_common: use signal_pending_state()
authorOleg Nesterov <oleg@tv-sign.ru>
Sun, 8 Jun 2008 17:20:42 +0000 (21:20 +0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 10 Jun 2008 09:45:09 +0000 (11:45 +0200)
Change __mutex_lock_common() to use signal_pending_state() for the sake of
the code re-use.

This adds 7 bytes to kernel/mutex.o, but afaics only because gcc isn't smart
enough.

(btw, uninlining of __mutex_lock_common() shrinks .text from 2722 to 1542,
 perhaps it is worth doing).

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/mutex.c

index d046a345d365793e84076e2517ec02cdd11bc40d..bcdc9ac8ef60da5a2937ce8205e58ab2a2350deb 100644 (file)
@@ -165,10 +165,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
                 * got a signal? (This code gets eliminated in the
                 * TASK_UNINTERRUPTIBLE case.)
                 */
-               if (unlikely((state == TASK_INTERRUPTIBLE &&
-                                       signal_pending(task)) ||
-                             (state == TASK_KILLABLE &&
-                                       fatal_signal_pending(task)))) {
+               if (unlikely(signal_pending_state(state, task))) {
                        mutex_remove_waiter(lock, &waiter,
                                            task_thread_info(task));
                        mutex_release(&lock->dep_map, 1, ip);