aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-27 03:07:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 15:57:56 -0400
commit67d1214551e800f9fe7dc7c47a346d2df0fafed5 (patch)
treeffcc93af9390339adda36668255e617073b724a1 /kernel
parent158e1645e07f3e9f7e4962d7a0997f5c3b98311b (diff)
merge task_work and rcu_head, get rid of separate allocation for keyring case
task_work and rcu_head are identical now; merge them (calling the result struct callback_head, rcu_head #define'd to it), kill separate allocation in security/keys since we can just use cred->rcu now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/manage.c4
-rw-r--r--kernel/task_work.c14
2 files changed, 9 insertions, 9 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index d1dd54734ce7..814c9ef6bba1 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -781,7 +781,7 @@ static void wake_threads_waitq(struct irq_desc *desc)
781 wake_up(&desc->wait_for_threads); 781 wake_up(&desc->wait_for_threads);
782} 782}
783 783
784static void irq_thread_dtor(struct task_work *unused) 784static void irq_thread_dtor(struct callback_head *unused)
785{ 785{
786 struct task_struct *tsk = current; 786 struct task_struct *tsk = current;
787 struct irq_desc *desc; 787 struct irq_desc *desc;
@@ -813,7 +813,7 @@ static void irq_thread_dtor(struct task_work *unused)
813 */ 813 */
814static int irq_thread(void *data) 814static int irq_thread(void *data)
815{ 815{
816 struct task_work on_exit_work; 816 struct callback_head on_exit_work;
817 static const struct sched_param param = { 817 static const struct sched_param param = {
818 .sched_priority = MAX_USER_RT_PRIO/2, 818 .sched_priority = MAX_USER_RT_PRIO/2,
819 }; 819 };
diff --git a/kernel/task_work.c b/kernel/task_work.c
index 9b8948dbdc60..76266fb665dc 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -3,7 +3,7 @@
3#include <linux/tracehook.h> 3#include <linux/tracehook.h>
4 4
5int 5int
6task_work_add(struct task_struct *task, struct task_work *twork, bool notify) 6task_work_add(struct task_struct *task, struct callback_head *twork, bool notify)
7{ 7{
8 unsigned long flags; 8 unsigned long flags;
9 int err = -ESRCH; 9 int err = -ESRCH;
@@ -19,8 +19,8 @@ task_work_add(struct task_struct *task, struct task_work *twork, bool notify)
19 */ 19 */
20 raw_spin_lock_irqsave(&task->pi_lock, flags); 20 raw_spin_lock_irqsave(&task->pi_lock, flags);
21 if (likely(!(task->flags & PF_EXITING))) { 21 if (likely(!(task->flags & PF_EXITING))) {
22 struct task_work *last = task->task_works; 22 struct callback_head *last = task->task_works;
23 struct task_work *first = last ? last->next : twork; 23 struct callback_head *first = last ? last->next : twork;
24 twork->next = first; 24 twork->next = first;
25 if (last) 25 if (last)
26 last->next = twork; 26 last->next = twork;
@@ -35,16 +35,16 @@ task_work_add(struct task_struct *task, struct task_work *twork, bool notify)
35 return err; 35 return err;
36} 36}
37 37
38struct task_work * 38struct callback_head *
39task_work_cancel(struct task_struct *task, task_work_func_t func) 39task_work_cancel(struct task_struct *task, task_work_func_t func)
40{ 40{
41 unsigned long flags; 41 unsigned long flags;
42 struct task_work *last, *res = NULL; 42 struct callback_head *last, *res = NULL;
43 43
44 raw_spin_lock_irqsave(&task->pi_lock, flags); 44 raw_spin_lock_irqsave(&task->pi_lock, flags);
45 last = task->task_works; 45 last = task->task_works;
46 if (last) { 46 if (last) {
47 struct task_work *q = last, *p = q->next; 47 struct callback_head *q = last, *p = q->next;
48 while (1) { 48 while (1) {
49 if (p->func == func) { 49 if (p->func == func) {
50 q->next = p->next; 50 q->next = p->next;
@@ -66,7 +66,7 @@ task_work_cancel(struct task_struct *task, task_work_func_t func)
66void task_work_run(void) 66void task_work_run(void)
67{ 67{
68 struct task_struct *task = current; 68 struct task_struct *task = current;
69 struct task_work *p, *q; 69 struct callback_head *p, *q;
70 70
71 raw_spin_lock_irq(&task->pi_lock); 71 raw_spin_lock_irq(&task->pi_lock);
72 p = task->task_works; 72 p = task->task_works;