aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/task_work.c
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/task_work.c
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/task_work.c')
-rw-r--r--kernel/task_work.c14
1 files changed, 7 insertions, 7 deletions
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;