X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fkthread.c;h=fc0767d8461a1d66c950fff2a4b6dcc9de0fcac6;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=2e60249d4a990761747fb79cd59b55326e770989;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/kernel/kthread.c b/kernel/kthread.c index 2e60249d4..fc0767d84 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -11,6 +11,7 @@ #include #include #include +#include #include struct kthread_create_info @@ -41,7 +42,7 @@ int kthread_should_stop(void) { return (kthread_stop_info.k == current); } - +EXPORT_SYMBOL(kthread_should_stop); static void kthread_exit_files(void) { @@ -64,7 +65,6 @@ static int kthread(void *_create) void *data; sigset_t blocked; int ret = -EINTR; - cpumask_t mask = CPU_MASK_ALL; kthread_exit_files(); @@ -78,7 +78,7 @@ static int kthread(void *_create) flush_signals(current); /* By default we can run anywhere, unlike keventd. */ - set_cpus_allowed(current, mask); + set_cpus_allowed(current, CPU_MASK_ALL); /* OK, tell user we're spawned, wait for stop or wakeup */ __set_current_state(TASK_INTERRUPTIBLE); @@ -108,7 +108,7 @@ static void keventd_create_kthread(void *_create) create->result = ERR_PTR(pid); } else { wait_for_completion(&create->started); - create->result = find_task_by_pid(pid); + create->result = find_task_by_real_pid(pid); } complete(&create->done); } @@ -144,6 +144,7 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), return create.result; } +EXPORT_SYMBOL(kthread_create); void kthread_bind(struct task_struct *k, unsigned int cpu) { @@ -153,6 +154,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu) set_task_cpu(k, cpu); k->cpus_allowed = cpumask_of_cpu(cpu); } +EXPORT_SYMBOL(kthread_bind); int kthread_stop(struct task_struct *k) { @@ -180,3 +182,4 @@ int kthread_stop(struct task_struct *k) return ret; } +EXPORT_SYMBOL(kthread_stop);