[PATCH 01/19] task_work: Remove dependency on sched.h

From: Peter Zijlstra
Date: Tue Jul 31 2012 - 15:47:18 EST


Remove the need for sched.h from task_work.h so that we can use struct
task_work in struct task_struct in a later patch.

Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
include/linux/task_work.h | 7 -------
kernel/exit.c | 5 ++++-
2 files changed, 4 insertions(+), 8 deletions(-)
--- a/include/linux/task_work.h
+++ b/include/linux/task_work.h
@@ -2,7 +2,6 @@
#define _LINUX_TASK_WORK_H

#include <linux/list.h>
-#include <linux/sched.h>

typedef void (*task_work_func_t)(struct callback_head *);

@@ -16,10 +15,4 @@ int task_work_add(struct task_struct *ta
struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
void task_work_run(void);

-static inline void exit_task_work(struct task_struct *task)
-{
- if (unlikely(task->task_works))
- task_work_run();
-}
-
#endif /* _LINUX_TASK_WORK_H */
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -992,7 +992,10 @@ void do_exit(long code)
exit_shm(tsk);
exit_files(tsk);
exit_fs(tsk);
- exit_task_work(tsk);
+
+ if (unlikely(tsk->task_works))
+ task_work_run();
+
check_stack_usage();
exit_thread();



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/