[PATCH] introduce sig_needs_tasklist() helper
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 29 Mar 2006 00:11:14 +0000 (16:11 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 29 Mar 2006 02:36:42 +0000 (18:36 -0800)
In my opinion this patch cleans up the code.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/signal.c

index 819fa49aa70a928512afba5a0421fe35ec9ef3c8..c5b65aa4c2bccfdcc82f919422f4b7589c2015f9 100644 (file)
@@ -147,6 +147,9 @@ static kmem_cache_t *sigqueue_cachep;
 #define sig_kernel_stop(sig) \
                (((sig) < SIGRTMIN)  && T(sig, SIG_KERNEL_STOP_MASK))
 
+#define sig_needs_tasklist(sig) \
+               (((sig) < SIGRTMIN)  && T(sig, SIG_KERNEL_STOP_MASK | M(SIGCONT)))
+
 #define sig_user_defined(t, signr) \
        (((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_DFL) &&  \
         ((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN))
@@ -1199,7 +1202,7 @@ kill_proc_info(int sig, struct siginfo *info, pid_t pid)
        struct task_struct *p;
 
        rcu_read_lock();
-       if (unlikely(sig_kernel_stop(sig) || sig == SIGCONT)) {
+       if (unlikely(sig_needs_tasklist(sig))) {
                read_lock(&tasklist_lock);
                acquired_tasklist_lock = 1;
        }