提交 ac5c2153 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

signals: join send_sigqueue() with send_group_sigqueue()

We export send_sigqueue() and send_group_sigqueue() for the only user,
posix_timer_event().  This is a bit silly, because both are just trivial
helpers on top of do_send_sigqueue() and because the we pass the unused
.si_signo parameter.

Kill them both, rename do_send_sigqueue() to send_sigqueue(), and export it.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e62e6650
...@@ -1751,8 +1751,7 @@ extern void zap_other_threads(struct task_struct *p); ...@@ -1751,8 +1751,7 @@ extern void zap_other_threads(struct task_struct *p);
extern int kill_proc(pid_t, int, int); extern int kill_proc(pid_t, int, int);
extern struct sigqueue *sigqueue_alloc(void); extern struct sigqueue *sigqueue_alloc(void);
extern void sigqueue_free(struct sigqueue *); extern void sigqueue_free(struct sigqueue *);
extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *);
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long);
......
...@@ -310,8 +310,7 @@ int posix_timer_event(struct k_itimer *timr,int si_private) ...@@ -310,8 +310,7 @@ int posix_timer_event(struct k_itimer *timr,int si_private)
if (timr->it_sigev_notify & SIGEV_THREAD_ID) { if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
struct task_struct *leader; struct task_struct *leader;
int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq, int ret = send_sigqueue(timr->sigq, timr->it_process, 0);
timr->it_process);
if (likely(ret >= 0)) if (likely(ret >= 0))
return ret; return ret;
...@@ -322,8 +321,7 @@ int posix_timer_event(struct k_itimer *timr,int si_private) ...@@ -322,8 +321,7 @@ int posix_timer_event(struct k_itimer *timr,int si_private)
timr->it_process = leader; timr->it_process = leader;
} }
return send_group_sigqueue(timr->it_sigev_signo, timr->sigq, return send_sigqueue(timr->sigq, timr->it_process, 1);
timr->it_process);
} }
EXPORT_SYMBOL_GPL(posix_timer_event); EXPORT_SYMBOL_GPL(posix_timer_event);
......
...@@ -1240,8 +1240,7 @@ void sigqueue_free(struct sigqueue *q) ...@@ -1240,8 +1240,7 @@ void sigqueue_free(struct sigqueue *q)
__sigqueue_free(q); __sigqueue_free(q);
} }
static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t, int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)
int group)
{ {
int sig = q->info.si_signo; int sig = q->info.si_signo;
struct sigpending *pending; struct sigpending *pending;
...@@ -1266,7 +1265,6 @@ static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t, ...@@ -1266,7 +1265,6 @@ static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t,
* If an SI_TIMER entry is already queue just increment * If an SI_TIMER entry is already queue just increment
* the overrun count. * the overrun count.
*/ */
BUG_ON(q->info.si_code != SI_TIMER); BUG_ON(q->info.si_code != SI_TIMER);
q->info.si_overrun++; q->info.si_overrun++;
goto out; goto out;
...@@ -1283,17 +1281,6 @@ static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t, ...@@ -1283,17 +1281,6 @@ static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t,
return ret; return ret;
} }
int send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
{
return do_send_sigqueue(q, p, 0);
}
int
send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
{
return do_send_sigqueue(q, p, 1);
}
/* /*
* Wake up any threads in the parent blocked in wait* syscalls. * Wake up any threads in the parent blocked in wait* syscalls.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册