Lines Matching refs:raidPtr
94 RF_Raid_t *raidPtr;
96 raidPtr = (RF_Raid_t *) arg;
99 rf_lock_mutex2(raidPtr->iodone_lock);
101 raidPtr->shutdown_raidio = 1;
102 rf_signal_cond2(raidPtr->iodone_cv);
105 while (raidPtr->shutdown_raidio)
106 rf_wait_cond2(raidPtr->iodone_cv, raidPtr->iodone_lock);
108 rf_unlock_mutex2(raidPtr->iodone_lock);
111 DO_LOCK(raidPtr);
112 raidPtr->shutdown_engine = 1;
113 DO_SIGNAL(raidPtr);
116 while (raidPtr->shutdown_engine)
117 DO_WAIT(raidPtr);
119 DO_UNLOCK(raidPtr);
121 rf_destroy_mutex2(raidPtr->node_queue_mutex);
122 rf_destroy_cond2(raidPtr->node_queue_cv);
124 rf_destroy_mutex2(raidPtr->iodone_lock);
125 rf_destroy_cond2(raidPtr->iodone_cv);
129 rf_ConfigureEngine(RF_ShutdownList_t **listp, RF_Raid_t *raidPtr,
136 TAILQ_INIT(&(raidPtr->iodone));
137 rf_init_mutex2(raidPtr->iodone_lock, IPL_VM);
138 rf_init_cond2(raidPtr->iodone_cv, "raidiow");
140 rf_init_mutex2(raidPtr->node_queue_mutex, IPL_VM);
141 rf_init_cond2(raidPtr->node_queue_cv, "rfnodeq");
142 raidPtr->node_queue = NULL;
143 raidPtr->dags_in_flight = 0;
150 printf("raid%d: Creating engine thread\n", raidPtr->raidid);
153 if (RF_CREATE_ENGINE_THREAD(raidPtr->engine_thread,
154 DAGExecutionThread, raidPtr,
155 "raid%d", raidPtr->raidid)) {
157 raidPtr->raidid);
160 if (RF_CREATE_ENGINE_THREAD(raidPtr->engine_helper_thread,
161 rf_RaidIOThread, raidPtr,
162 "raidio%d", raidPtr->raidid)) {
164 raidPtr->raidid);
169 printf("raid%d: Created engine thread\n", raidPtr->raidid);
176 printf("raid%d: Engine thread running and waiting for events\n", raidPtr->raidid);
179 rf_ShutdownCreate(listp, rf_ShutdownEngine, raidPtr);
274 node->dagHdr->raidPtr->raidid,
295 node->dagHdr->raidPtr->raidid,
427 RF_Raid_t *raidPtr;
437 raidPtr = node->dagHdr->raidPtr;
439 DO_LOCK(raidPtr);
511 q->next = raidPtr->node_queue;
512 raidPtr->node_queue = qh;
513 DO_SIGNAL(raidPtr);
515 DO_UNLOCK(raidPtr);
592 q->next = raidPtr->node_queue;
593 raidPtr->node_queue = qh;
594 DO_SIGNAL(raidPtr);
596 DO_UNLOCK(raidPtr);
633 RF_Raid_t *raidPtr;
635 raidPtr = node->dagHdr->raidPtr;
649 printf("raid%d: node (%s) returned fail, rolling forward\n", raidPtr->raidid, node->name);
657 printf("raid%d: node (%s) returned fail, rolling backward\n", raidPtr->raidid, node->name);
709 RF_Raid_t *raidPtr;
711 raidPtr = dag->raidPtr;
727 printf("raid%d: Entering DispatchDAG\n", raidPtr->raidid);
730 raidPtr->dags_in_flight++; /* debug only: blow off proper
751 RF_Raid_t *raidPtr;
753 raidPtr = (RF_Raid_t *) arg;
757 printf("raid%d: Engine thread is running\n", raidPtr->raidid);
761 DO_LOCK(raidPtr);
762 while (!raidPtr->shutdown_engine) {
764 while (raidPtr->node_queue != NULL) {
765 local_nq = raidPtr->node_queue;
768 raidPtr->node_queue = NULL;
769 DO_UNLOCK(raidPtr);
816 raidPtr->dags_in_flight--; /* debug only */
822 DO_LOCK(raidPtr);
824 while (!raidPtr->shutdown_engine &&
825 raidPtr->node_queue == NULL) {
826 DO_WAIT(raidPtr);
831 raidPtr->shutdown_engine = 0;
832 DO_SIGNAL(raidPtr);
834 DO_UNLOCK(raidPtr);
841 * puts the I/O on a buffer queue, and then signals raidPtr->iodone. If
844 * completed request onto raidPtr->iodone TAILQ. This function looks
852 RF_Raid_t *raidPtr;
855 raidPtr = (RF_Raid_t *) arg;
857 rf_lock_mutex2(raidPtr->iodone_lock);
859 while (!raidPtr->shutdown_raidio) {
861 if (TAILQ_EMPTY(&(raidPtr->iodone)) &&
862 rf_buf_queue_check(raidPtr)) {
863 rf_wait_cond2(raidPtr->iodone_cv, raidPtr->iodone_lock);
867 if (raidPtr->parity_map != NULL) {
868 rf_unlock_mutex2(raidPtr->iodone_lock);
869 rf_paritymap_checkwork(raidPtr->parity_map);
870 rf_lock_mutex2(raidPtr->iodone_lock);
874 while ((req = TAILQ_FIRST(&(raidPtr->iodone))) != NULL) {
875 TAILQ_REMOVE(&(raidPtr->iodone), req, iodone_entries);
876 rf_unlock_mutex2(raidPtr->iodone_lock);
879 rf_lock_mutex2(raidPtr->iodone_lock);
883 rf_unlock_mutex2(raidPtr->iodone_lock);
884 raidstart(raidPtr);
885 rf_lock_mutex2(raidPtr->iodone_lock);
890 raidPtr->shutdown_raidio = 0;
891 rf_signal_cond2(raidPtr->iodone_cv);
893 rf_unlock_mutex2(raidPtr->iodone_lock);