diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-10-30 18:02:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:19 -0500 |
commit | 19a4fcb531659f2f7d18b5d04cee039176e9540d (patch) | |
tree | 30e0636d6163a5c0c3a4ad41c2d5f49cd858b457 /kernel/signal.c | |
parent | 932aeafbe8521a9a9d790152d66020e0fef2029b (diff) |
[PATCH] kill sigqueue->lock
This lock is used in sigqueue_free(), but it is always equal to
current->sighand->siglock, so we don't need to keep it in the struct
sigqueue.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 6904bbbfe116..8d6e64dfa5c6 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -277,7 +277,6 @@ static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags, | |||
277 | } else { | 277 | } else { |
278 | INIT_LIST_HEAD(&q->list); | 278 | INIT_LIST_HEAD(&q->list); |
279 | q->flags = 0; | 279 | q->flags = 0; |
280 | q->lock = NULL; | ||
281 | q->user = get_uid(t->user); | 280 | q->user = get_uid(t->user); |
282 | } | 281 | } |
283 | return(q); | 282 | return(q); |
@@ -1371,11 +1370,12 @@ void sigqueue_free(struct sigqueue *q) | |||
1371 | * pending queue. | 1370 | * pending queue. |
1372 | */ | 1371 | */ |
1373 | if (unlikely(!list_empty(&q->list))) { | 1372 | if (unlikely(!list_empty(&q->list))) { |
1374 | read_lock(&tasklist_lock); | 1373 | spinlock_t *lock = ¤t->sighand->siglock; |
1375 | spin_lock_irqsave(q->lock, flags); | 1374 | read_lock(&tasklist_lock); |
1375 | spin_lock_irqsave(lock, flags); | ||
1376 | if (!list_empty(&q->list)) | 1376 | if (!list_empty(&q->list)) |
1377 | list_del_init(&q->list); | 1377 | list_del_init(&q->list); |
1378 | spin_unlock_irqrestore(q->lock, flags); | 1378 | spin_unlock_irqrestore(lock, flags); |
1379 | read_unlock(&tasklist_lock); | 1379 | read_unlock(&tasklist_lock); |
1380 | } | 1380 | } |
1381 | q->flags &= ~SIGQUEUE_PREALLOC; | 1381 | q->flags &= ~SIGQUEUE_PREALLOC; |
@@ -1414,7 +1414,6 @@ send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) | |||
1414 | goto out; | 1414 | goto out; |
1415 | } | 1415 | } |
1416 | 1416 | ||
1417 | q->lock = &p->sighand->siglock; | ||
1418 | list_add_tail(&q->list, &p->pending.list); | 1417 | list_add_tail(&q->list, &p->pending.list); |
1419 | sigaddset(&p->pending.signal, sig); | 1418 | sigaddset(&p->pending.signal, sig); |
1420 | if (!sigismember(&p->blocked, sig)) | 1419 | if (!sigismember(&p->blocked, sig)) |
@@ -1462,7 +1461,6 @@ send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) | |||
1462 | * We always use the shared queue for process-wide signals, | 1461 | * We always use the shared queue for process-wide signals, |
1463 | * to avoid several races. | 1462 | * to avoid several races. |
1464 | */ | 1463 | */ |
1465 | q->lock = &p->sighand->siglock; | ||
1466 | list_add_tail(&q->list, &p->signal->shared_pending.list); | 1464 | list_add_tail(&q->list, &p->signal->shared_pending.list); |
1467 | sigaddset(&p->signal->shared_pending.signal, sig); | 1465 | sigaddset(&p->signal->shared_pending.signal, sig); |
1468 | 1466 | ||