RF_ERRORMSG("RAIDFRAME: Unable to create engine"
RF_ERRORMSG("RAIDFRAME: Unable to start engine"
rf_ConfigureEngine(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,    RF_Config_t *cfgPtr){	int rc;	char raidname[16];	DO_INIT(listp, raidPtr);	raidPtr->node_queue = NULL;	raidPtr->dags_in_flight = 0;	rc = rf_init_managed_threadgroup(listp, &raidPtr->engine_tg);	if (rc)		return (rc);	/*	 * We create the execution thread only once per system boot. No need	 * to check return code b/c the kernel panics if it can't create the	 * thread.	 */	if (rf_engineDebug) {		printf("raid%d: Creating engine thread\n", raidPtr->raidid);	}	if (rf_hook_cookies == NULL) {		rf_hook_cookies =		    malloc(numraid * sizeof(void *),			   M_RAIDFRAME, M_NOWAIT);		if (rf_hook_cookies == NULL)			return (ENOMEM);		bzero(rf_hook_cookies, numraid * sizeof(void *));	}#ifdef	RAID_AUTOCONFIG	if (initproc == NULL) {		rf_hook_cookies[raidPtr->raidid] =			startuphook_establish(rf_DAGExecutionThread_pre,			    raidPtr);	} else {#endif	/* RAID_AUTOCONFIG */		snprintf(&raidname[0], 16, "raid%d", raidPtr->raidid);		if (RF_CREATE_THREAD(raidPtr->engine_thread,		    rf_DAGExecutionThread, raidPtr, &raidname[0])) {			RF_ERRORMSG("RAIDFRAME: Unable to create engine"			    " thread\n");			return (ENOMEM);		}		if (rf_engineDebug) {			printf("raid%d: Created engine thread\n",			    raidPtr->raidid);		}		RF_THREADGROUP_STARTED(&raidPtr->engine_tg);#ifdef	RAID_AUTOCONFIG	}#endif	/* XXX Something is missing here... */#ifdef	debug	printf("Skipping the WAIT_START !!!\n");#endif	/* Engine thread is now running and waiting for work. */	if (rf_engineDebug) {		printf("raid%d: Engine thread running and waiting for events\n",		    raidPtr->raidid);	}	rc = rf_ShutdownCreate(listp, rf_ShutdownEngine, raidPtr);	if (rc) {		RF_ERRORMSG3("Unable to add to shutdown list file %s line %d"		    " rc=%d\n", __FILE__, __LINE__, rc);		rf_ShutdownEngine(NULL);	}	return (rc);}