/* Returns the result of threadfn(), or %-EINTR if wake_up_process() was never called.  */
int kthread_stop(struct task_struct *k)
/* Returns the result of threadfn(), or %-EINTR if wake_up_process() was never called.  */
int kthread_stop(struct task_struct *k)
{
	struct kthread *kthread;
	int ret;
	trace_sched_kthread_stop(k);
	get_task_struct(k);
	kthread = to_kthread(k);
	barrier();
	if (k->vfork_done != NULL) {
		kthread->should_stop = 1;
		wake_up_process(k);
		wait_for_completion(&kthread->exited);
	}
	ret = k->exit_code;
	put_task_struct(k);
	trace_sched_kthread_stop_ret(ret);
	return ret;
}