Commit a9e88e84 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

[PATCH] introduce sig_needs_tasklist() helper

In my opinion this patch cleans up the code.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f63ee72e
...@@ -147,6 +147,9 @@ static kmem_cache_t *sigqueue_cachep; ...@@ -147,6 +147,9 @@ static kmem_cache_t *sigqueue_cachep;
#define sig_kernel_stop(sig) \ #define sig_kernel_stop(sig) \
(((sig) < SIGRTMIN) && T(sig, SIG_KERNEL_STOP_MASK)) (((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) \ #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_DFL) && \
((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN)) ((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) ...@@ -1199,7 +1202,7 @@ kill_proc_info(int sig, struct siginfo *info, pid_t pid)
struct task_struct *p; struct task_struct *p;
rcu_read_lock(); rcu_read_lock();
if (unlikely(sig_kernel_stop(sig) || sig == SIGCONT)) { if (unlikely(sig_needs_tasklist(sig))) {
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
acquired_tasklist_lock = 1; acquired_tasklist_lock = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment