thread->timeout = MAX_SCHEDULE_TIMEOUT;
mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,				 const char *name){	mdk_thread_t *thread;	int ret;	struct completion event;	thread = (mdk_thread_t *) kmalloc				(sizeof(mdk_thread_t), GFP_KERNEL);	if (!thread)		return NULL;	memset(thread, 0, sizeof(mdk_thread_t));	init_waitqueue_head(&thread->wqueue);	init_completion(&event);	thread->event = &event;	thread->run = run;	thread->mddev = mddev;	thread->name = name;	ret = kernel_thread(md_thread, thread, 0);	if (ret < 0) {		kfree(thread);		return NULL;	}	wait_for_completion(&event);	return thread;}