From: Tim Schmielau Do not include sched.h from module.h. Also move some stuff to wait.h where it fits better (this part actually is from a patch by Dave Jones). This reduces the number of files directly or indirectly including sched.h from 5492 to 5057 on i386. Further reduction of this number is possible and will be achieved with future patches. Extensive ctags- and grep-based analysis was performed for all architectures to locate files that rely on indirectly including sched.h through module.h. Fixes for these where submitted previously. Compile tested with allnoconfig, defconfig and allmodconfig on i386, x86_64, alpha, ppc64, ia64, arm, mips and um (not that all of these actually build, but make -k gives the same messages with and without this patch). Still this patch bears some risk of compile breakage, which should however be easily fixed when uncovered. Analysis and compile tests where done against 2.6.14-git3. A quick x86_64 only compile test seems to indicate the patch still applies well to 2.6.14-git7. Signed-off-by: Tim Schmielau Signed-off-by: Andrew Morton --- include/linux/module.h | 6 ++++-- include/linux/sched.h | 11 ++--------- include/linux/wait.h | 10 ++++++++++ 3 files changed, 16 insertions(+), 11 deletions(-) diff -puN include/linux/module.h~dont-include-schedh-from-moduleh include/linux/module.h --- devel/include/linux/module.h~dont-include-schedh-from-moduleh 2005-11-04 23:26:12.000000000 -0800 +++ devel-akpm/include/linux/module.h 2005-11-04 23:26:12.000000000 -0800 @@ -7,7 +7,6 @@ * Rewritten again by Rusty Russell, 2002 */ #include -#include #include #include #include @@ -18,8 +17,11 @@ #include #include #include -#include +#include +#include +#include +#include #include /* Not Yet Implemented */ diff -puN include/linux/sched.h~dont-include-schedh-from-moduleh include/linux/sched.h --- devel/include/linux/sched.h~dont-include-schedh-from-moduleh 2005-11-04 23:26:12.000000000 -0800 +++ devel-akpm/include/linux/sched.h 2005-11-04 23:26:12.000000000 -0800 @@ -1049,15 +1049,8 @@ extern void switch_uid(struct user_struc extern void do_timer(struct pt_regs *); -extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); -extern int FASTCALL(wake_up_process(struct task_struct * tsk)); -extern void FASTCALL(wake_up_new_task(struct task_struct * tsk, - unsigned long clone_flags)); -#ifdef CONFIG_SMP - extern void kick_process(struct task_struct *tsk); -#else - static inline void kick_process(struct task_struct *tsk) { } -#endif +#include + extern void FASTCALL(sched_fork(task_t * p, int clone_flags)); extern void FASTCALL(sched_exit(task_t * p)); diff -puN include/linux/wait.h~dont-include-schedh-from-moduleh include/linux/wait.h --- devel/include/linux/wait.h~dont-include-schedh-from-moduleh 2005-11-04 23:26:12.000000000 -0800 +++ devel-akpm/include/linux/wait.h 2005-11-04 23:26:12.000000000 -0800 @@ -148,6 +148,16 @@ int FASTCALL(out_of_line_wait_on_bit(voi int FASTCALL(out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned)); wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int)); +extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); +extern int FASTCALL(wake_up_process(struct task_struct * tsk)); +extern void FASTCALL(wake_up_new_task(struct task_struct * tsk, + unsigned long clone_flags)); +#ifdef CONFIG_SMP + extern void kick_process(struct task_struct *tsk); +#else + static inline void kick_process(struct task_struct *tsk) { } +#endif + #define wake_up(x) __wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, NULL) #define wake_up_nr(x, nr) __wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr, NULL) #define wake_up_all(x) __wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0, NULL) _