aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-04-30 03:52:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:36 -0400
commitac5c215383f43a106ba4ef298126bf78c126f5e9 (patch)
tree77340eea86103df7bc3b4a6c6d83f4140004bc9c
parente62e6650e99a3dffcd0bf0d063cd818fbc13fa95 (diff)
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: Oleg Nesterov <oleg@tv-sign.ru> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/sched.h3
-rw-r--r--kernel/posix-timers.c6
-rw-r--r--kernel/signal.c15
3 files changed, 4 insertions, 20 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ef5615270342..0917b3df12d5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1751,8 +1751,7 @@ extern void zap_other_threads(struct task_struct *p);
1751extern int kill_proc(pid_t, int, int); 1751extern int kill_proc(pid_t, int, int);
1752extern struct sigqueue *sigqueue_alloc(void); 1752extern struct sigqueue *sigqueue_alloc(void);
1753extern void sigqueue_free(struct sigqueue *); 1753extern void sigqueue_free(struct sigqueue *);
1754extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); 1754extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
1755extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *);
1756extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); 1755extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
1757extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); 1756extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long);
1758 1757
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 8476956ffd92..dbd8398ddb0b 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -310,8 +310,7 @@ int posix_timer_event(struct k_itimer *timr,int si_private)
310 310
311 if (timr->it_sigev_notify & SIGEV_THREAD_ID) { 311 if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
312 struct task_struct *leader; 312 struct task_struct *leader;
313 int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq, 313 int ret = send_sigqueue(timr->sigq, timr->it_process, 0);
314 timr->it_process);
315 314
316 if (likely(ret >= 0)) 315 if (likely(ret >= 0))
317 return ret; 316 return ret;
@@ -322,8 +321,7 @@ int posix_timer_event(struct k_itimer *timr,int si_private)
322 timr->it_process = leader; 321 timr->it_process = leader;
323 } 322 }
324 323
325 return send_group_sigqueue(timr->it_sigev_signo, timr->sigq, 324 return send_sigqueue(timr->sigq, timr->it_process, 1);
326 timr->it_process);
327} 325}
328EXPORT_SYMBOL_GPL(posix_timer_event); 326EXPORT_SYMBOL_GPL(posix_timer_event);
329 327
diff --git a/kernel/signal.c b/kernel/signal.c
index 367c6662b12f..d52a1fe921fa 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1240,8 +1240,7 @@ void sigqueue_free(struct sigqueue *q)
1240 __sigqueue_free(q); 1240 __sigqueue_free(q);
1241} 1241}
1242 1242
1243static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t, 1243int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)
1244 int group)
1245{ 1244{
1246 int sig = q->info.si_signo; 1245 int sig = q->info.si_signo;
1247 struct sigpending *pending; 1246 struct sigpending *pending;
@@ -1266,7 +1265,6 @@ static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t,
1266 * If an SI_TIMER entry is already queue just increment 1265 * If an SI_TIMER entry is already queue just increment
1267 * the overrun count. 1266 * the overrun count.
1268 */ 1267 */
1269
1270 BUG_ON(q->info.si_code != SI_TIMER); 1268 BUG_ON(q->info.si_code != SI_TIMER);
1271 q->info.si_overrun++; 1269 q->info.si_overrun++;
1272 goto out; 1270 goto out;
@@ -1283,17 +1281,6 @@ ret:
1283 return ret; 1281 return ret;
1284} 1282}
1285 1283
1286int send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
1287{
1288 return do_send_sigqueue(q, p, 0);
1289}
1290
1291int
1292send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
1293{
1294 return do_send_sigqueue(q, p, 1);
1295}
1296
1297/* 1284/*
1298 * Wake up any threads in the parent blocked in wait* syscalls. 1285 * Wake up any threads in the parent blocked in wait* syscalls.
1299 */ 1286 */