summaryrefslogtreecommitdiffstats
path: root/kernel/task_work.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-27 11:07:19 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 23:57:56 +0400
commit67d1214551e800f9fe7dc7c47a346d2df0fafed5 (patch)
treeffcc93af9390339adda36668255e617073b724a1 /kernel/task_work.c
parent158e1645e07f3e9f7e4962d7a0997f5c3b98311b (diff)
downloadlinux-67d1214551e800f9fe7dc7c47a346d2df0fafed5.tar.gz
linux-67d1214551e800f9fe7dc7c47a346d2df0fafed5.tar.bz2
linux-67d1214551e800f9fe7dc7c47a346d2df0fafed5.zip
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 @@
#include <linux/tracehook.h>
int
-task_work_add(struct task_struct *task, struct task_work *twork, bool notify)
+task_work_add(struct task_struct *task, struct callback_head *twork, bool notify)
{
unsigned long flags;
int err = -ESRCH;
@@ -19,8 +19,8 @@ task_work_add(struct task_struct *task, struct task_work *twork, bool notify)
*/
raw_spin_lock_irqsave(&task->pi_lock, flags);
if (likely(!(task->flags & PF_EXITING))) {
- struct task_work *last = task->task_works;
- struct task_work *first = last ? last->next : twork;
+ struct callback_head *last = task->task_works;
+ struct callback_head *first = last ? last->next : twork;
twork->next = first;
if (last)
last->next = twork;
@@ -35,16 +35,16 @@ task_work_add(struct task_struct *task, struct task_work *twork, bool notify)
return err;
}
-struct task_work *
+struct callback_head *
task_work_cancel(struct task_struct *task, task_work_func_t func)
{
unsigned long flags;
- struct task_work *last, *res = NULL;
+ struct callback_head *last, *res = NULL;
raw_spin_lock_irqsave(&task->pi_lock, flags);
last = task->task_works;
if (last) {
- struct task_work *q = last, *p = q->next;
+ struct callback_head *q = last, *p = q->next;
while (1) {
if (p->func == func) {
q->next = p->next;
@@ -66,7 +66,7 @@ task_work_cancel(struct task_struct *task, task_work_func_t func)
void task_work_run(void)
{
struct task_struct *task = current;
- struct task_work *p, *q;
+ struct callback_head *p, *q;
raw_spin_lock_irq(&task->pi_lock);
p = task->task_works;