Lines Matching refs:raidPtr
65 static void FreeRegionInfo(RF_Raid_t * raidPtr, RF_RegionId_t regionID);
76 RF_Raid_t * raidPtr, in rf_ConfigureParityLogging() argument
82 RF_RaidLayout_t *layoutPtr = &raidPtr->Layout; in rf_ConfigureParityLogging()
97 raidPtr->numSectorsPerLog = RF_DEFAULT_NUM_SECTORS_PER_LOG; in rf_ConfigureParityLogging()
100 info = RF_MallocAndAdd(sizeof(*info), raidPtr->cleanupList); in rf_ConfigureParityLogging()
107 info->stripeIdentifier = rf_make_2d_array((raidPtr->numCol), in rf_ConfigureParityLogging()
108 (raidPtr->numCol), in rf_ConfigureParityLogging()
109 raidPtr->cleanupList); in rf_ConfigureParityLogging()
114 for (i = 0; i < (raidPtr->numCol); i++) { in rf_ConfigureParityLogging()
115 for (j = 0; j < (raidPtr->numCol); j++) { in rf_ConfigureParityLogging()
117 (raidPtr->numCol - 1); in rf_ConfigureParityLogging()
120 startdisk = raidPtr->numCol - 1 - 1; in rf_ConfigureParityLogging()
127 layoutPtr->numDataCol = raidPtr->numCol - layoutPtr->numParityCol - in rf_ConfigureParityLogging()
132 raidPtr->sectorsPerDisk = layoutPtr->stripeUnitsPerDisk * in rf_ConfigureParityLogging()
135 raidPtr->totalSectors = layoutPtr->stripeUnitsPerDisk * in rf_ConfigureParityLogging()
161 raidPtr->regionLogCapacity = totalLogCapacity / rf_numParityRegions; in rf_ConfigureParityLogging()
163 printf("bytes per sector %d\n", raidPtr->bytesPerSector); in rf_ConfigureParityLogging()
168 fragmentation = raidPtr->regionLogCapacity % raidPtr->numSectorsPerLog; in rf_ConfigureParityLogging()
170 for (i = 1; i < (raidPtr->numSectorsPerLog / 2); i++) { in rf_ConfigureParityLogging()
172 raidPtr->numSectorsPerLog) < fragmentation) { in rf_ConfigureParityLogging()
174 raidPtr->regionLogCapacity = totalLogCapacity / in rf_ConfigureParityLogging()
176 fragmentation = raidPtr->regionLogCapacity % in rf_ConfigureParityLogging()
177 raidPtr->numSectorsPerLog; in rf_ConfigureParityLogging()
180 raidPtr->numSectorsPerLog) < fragmentation) { in rf_ConfigureParityLogging()
182 raidPtr->regionLogCapacity = totalLogCapacity / in rf_ConfigureParityLogging()
184 fragmentation = raidPtr->regionLogCapacity % in rf_ConfigureParityLogging()
185 raidPtr->numSectorsPerLog; in rf_ConfigureParityLogging()
189 raidPtr->regionLogCapacity = (raidPtr->regionLogCapacity / in rf_ConfigureParityLogging()
190 raidPtr->numSectorsPerLog) * in rf_ConfigureParityLogging()
191 raidPtr->numSectorsPerLog; in rf_ConfigureParityLogging()
193 raidPtr->numParityLogs = rf_totalInCoreLogCapacity / in rf_ConfigureParityLogging()
194 (raidPtr->bytesPerSector * raidPtr->numSectorsPerLog); in rf_ConfigureParityLogging()
197 if (raidPtr->numParityLogs < rf_numParityRegions) in rf_ConfigureParityLogging()
198 raidPtr->numParityLogs = rf_numParityRegions; in rf_ConfigureParityLogging()
203 raidPtr->regionInfo = RF_Malloc( in rf_ConfigureParityLogging()
204 rf_numParityRegions * sizeof(*raidPtr->regionInfo)); in rf_ConfigureParityLogging()
205 if (raidPtr->regionInfo == NULL) in rf_ConfigureParityLogging()
209 lastRegionCapacity = raidPtr->regionLogCapacity; in rf_ConfigureParityLogging()
210 while ((rf_numParityRegions - 1) * raidPtr->regionLogCapacity + in rf_ConfigureParityLogging()
213 raidPtr->numSectorsPerLog; in rf_ConfigureParityLogging()
215 raidPtr->regionParityRange = raidPtr->sectorsPerDisk / in rf_ConfigureParityLogging()
217 maxRegionParityRange = raidPtr->regionParityRange; in rf_ConfigureParityLogging()
225 raidPtr->numParityLogs * raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
226 raidPtr->bytesPerSector, in rf_ConfigureParityLogging()
227 raidPtr->numParityLogs); in rf_ConfigureParityLogging()
228 raidPtr->parityLogBufferHeap = RF_Malloc(raidPtr->numParityLogs in rf_ConfigureParityLogging()
229 * raidPtr->numSectorsPerLog * raidPtr->bytesPerSector); in rf_ConfigureParityLogging()
230 if (raidPtr->parityLogBufferHeap == NULL) in rf_ConfigureParityLogging()
232 lHeapPtr = raidPtr->parityLogBufferHeap; in rf_ConfigureParityLogging()
233 rf_init_mutex2(raidPtr->parityLogPool.mutex, IPL_VM); in rf_ConfigureParityLogging()
234 for (i = 0; i < raidPtr->numParityLogs; i++) { in rf_ConfigureParityLogging()
236 raidPtr->parityLogPool.parityLogs = in rf_ConfigureParityLogging()
238 sizeof(*raidPtr->parityLogPool.parityLogs)); in rf_ConfigureParityLogging()
239 if (raidPtr->parityLogPool.parityLogs == NULL) { in rf_ConfigureParityLogging()
240 RF_Free(raidPtr->parityLogBufferHeap, in rf_ConfigureParityLogging()
241 raidPtr->numParityLogs * in rf_ConfigureParityLogging()
242 raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
243 raidPtr->bytesPerSector); in rf_ConfigureParityLogging()
246 l = raidPtr->parityLogPool.parityLogs; in rf_ConfigureParityLogging()
250 RF_Free(raidPtr->parityLogBufferHeap, in rf_ConfigureParityLogging()
251 raidPtr->numParityLogs * in rf_ConfigureParityLogging()
252 raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
253 raidPtr->bytesPerSector); in rf_ConfigureParityLogging()
254 for (l = raidPtr->parityLogPool.parityLogs; in rf_ConfigureParityLogging()
259 RF_Free(l->records, (raidPtr->numSectorsPerLog * sizeof(RF_ParityLogRecord_t))); in rf_ConfigureParityLogging()
267 lHeapPtr = (char *)lHeapPtr + raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
268 raidPtr->bytesPerSector; in rf_ConfigureParityLogging()
269 l->records = RF_Malloc(raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
272 RF_Free(raidPtr->parityLogBufferHeap, in rf_ConfigureParityLogging()
273 raidPtr->numParityLogs * in rf_ConfigureParityLogging()
274 raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
275 raidPtr->bytesPerSector); in rf_ConfigureParityLogging()
276 for (l = raidPtr->parityLogPool.parityLogs; in rf_ConfigureParityLogging()
282 (raidPtr->numSectorsPerLog * in rf_ConfigureParityLogging()
289 rf_ShutdownCreate(listp, rf_ShutdownParityLoggingPool, raidPtr); in rf_ConfigureParityLogging()
291 rf_init_mutex2(raidPtr->regionBufferPool.mutex, IPL_VM); in rf_ConfigureParityLogging()
292 rf_init_cond2(raidPtr->regionBufferPool.cond, "rfrbpl"); in rf_ConfigureParityLogging()
293 raidPtr->regionBufferPool.bufferSize = raidPtr->regionLogCapacity * in rf_ConfigureParityLogging()
294 raidPtr->bytesPerSector; in rf_ConfigureParityLogging()
296 raidPtr->regionBufferPool.bufferSize); in rf_ConfigureParityLogging()
299 raidPtr->regionBufferPool.totalBuffers = 1; in rf_ConfigureParityLogging()
301 raidPtr->regionBufferPool.availableBuffers = in rf_ConfigureParityLogging()
302 raidPtr->regionBufferPool.totalBuffers; in rf_ConfigureParityLogging()
303 raidPtr->regionBufferPool.availBuffersIndex = 0; in rf_ConfigureParityLogging()
304 raidPtr->regionBufferPool.emptyBuffersIndex = 0; in rf_ConfigureParityLogging()
306 (int) (raidPtr->regionBufferPool.totalBuffers * in rf_ConfigureParityLogging()
308 raidPtr->regionBufferPool.buffers = RF_Malloc( in rf_ConfigureParityLogging()
309 raidPtr->regionBufferPool.totalBuffers * in rf_ConfigureParityLogging()
310 sizeof(*raidPtr->regionBufferPool.buffers)); in rf_ConfigureParityLogging()
311 if (raidPtr->regionBufferPool.buffers == NULL) { in rf_ConfigureParityLogging()
314 for (i = 0; i < raidPtr->regionBufferPool.totalBuffers; i++) { in rf_ConfigureParityLogging()
316 (int) (raidPtr->regionBufferPool.bufferSize * in rf_ConfigureParityLogging()
318 raidPtr->regionBufferPool.buffers[i] = in rf_ConfigureParityLogging()
319 RF_Malloc(raidPtr->regionBufferPool.bufferSize); in rf_ConfigureParityLogging()
320 if (raidPtr->regionBufferPool.buffers[i] == NULL) { in rf_ConfigureParityLogging()
322 RF_Free(raidPtr->regionBufferPool.buffers[i], in rf_ConfigureParityLogging()
323 raidPtr->regionBufferPool.bufferSize * in rf_ConfigureParityLogging()
326 RF_Free(raidPtr->regionBufferPool.buffers, in rf_ConfigureParityLogging()
327 raidPtr->regionBufferPool.totalBuffers * in rf_ConfigureParityLogging()
332 (long) raidPtr->regionBufferPool.buffers[i]); in rf_ConfigureParityLogging()
336 raidPtr); in rf_ConfigureParityLogging()
339 rf_init_mutex2(raidPtr->parityBufferPool.mutex, IPL_VM); in rf_ConfigureParityLogging()
340 rf_init_cond2(raidPtr->parityBufferPool.cond, "rfpbpl"); in rf_ConfigureParityLogging()
341 raidPtr->parityBufferPool.bufferSize = parityBufferCapacity * in rf_ConfigureParityLogging()
342 raidPtr->bytesPerSector; in rf_ConfigureParityLogging()
344 raidPtr->parityBufferPool.bufferSize); in rf_ConfigureParityLogging()
347 raidPtr->parityBufferPool.totalBuffers = 1; in rf_ConfigureParityLogging()
349 raidPtr->parityBufferPool.availableBuffers = in rf_ConfigureParityLogging()
350 raidPtr->parityBufferPool.totalBuffers; in rf_ConfigureParityLogging()
351 raidPtr->parityBufferPool.availBuffersIndex = 0; in rf_ConfigureParityLogging()
352 raidPtr->parityBufferPool.emptyBuffersIndex = 0; in rf_ConfigureParityLogging()
354 (int) (raidPtr->parityBufferPool.totalBuffers * in rf_ConfigureParityLogging()
356 raidPtr->parityBufferPool.totalBuffers ); in rf_ConfigureParityLogging()
357 raidPtr->parityBufferPool.buffers = RF_Malloc( in rf_ConfigureParityLogging()
358 raidPtr->parityBufferPool.totalBuffers * in rf_ConfigureParityLogging()
359 sizeof(*raidPtr->parityBufferPool.buffers)); in rf_ConfigureParityLogging()
360 if (raidPtr->parityBufferPool.buffers == NULL) { in rf_ConfigureParityLogging()
363 for (i = 0; i < raidPtr->parityBufferPool.totalBuffers; i++) { in rf_ConfigureParityLogging()
365 (int) (raidPtr->parityBufferPool.bufferSize * in rf_ConfigureParityLogging()
367 raidPtr->parityBufferPool.buffers[i] = RF_Malloc( in rf_ConfigureParityLogging()
368 raidPtr->parityBufferPool.bufferSize); in rf_ConfigureParityLogging()
369 if (raidPtr->parityBufferPool.buffers == NULL) { in rf_ConfigureParityLogging()
371 RF_Free(raidPtr->parityBufferPool.buffers[i], in rf_ConfigureParityLogging()
372 raidPtr->regionBufferPool.bufferSize * in rf_ConfigureParityLogging()
375 RF_Free(raidPtr->parityBufferPool.buffers, in rf_ConfigureParityLogging()
376 raidPtr->regionBufferPool.totalBuffers * in rf_ConfigureParityLogging()
381 (long) raidPtr->parityBufferPool.buffers[i]); in rf_ConfigureParityLogging()
385 raidPtr); in rf_ConfigureParityLogging()
387 rf_init_mutex2(raidPtr->parityLogDiskQueue.mutex, IPL_VM); in rf_ConfigureParityLogging()
388 rf_init_cond2(raidPtr->parityLogDiskQueue.cond, "rfpldq"); in rf_ConfigureParityLogging()
389 raidPtr->parityLogDiskQueue.flushQueue = NULL; in rf_ConfigureParityLogging()
390 raidPtr->parityLogDiskQueue.reintQueue = NULL; in rf_ConfigureParityLogging()
391 raidPtr->parityLogDiskQueue.bufHead = NULL; in rf_ConfigureParityLogging()
392 raidPtr->parityLogDiskQueue.bufTail = NULL; in rf_ConfigureParityLogging()
393 raidPtr->parityLogDiskQueue.reintHead = NULL; in rf_ConfigureParityLogging()
394 raidPtr->parityLogDiskQueue.reintTail = NULL; in rf_ConfigureParityLogging()
395 raidPtr->parityLogDiskQueue.logBlockHead = NULL; in rf_ConfigureParityLogging()
396 raidPtr->parityLogDiskQueue.logBlockTail = NULL; in rf_ConfigureParityLogging()
397 raidPtr->parityLogDiskQueue.reintBlockHead = NULL; in rf_ConfigureParityLogging()
398 raidPtr->parityLogDiskQueue.reintBlockTail = NULL; in rf_ConfigureParityLogging()
399 raidPtr->parityLogDiskQueue.freeDataList = NULL; in rf_ConfigureParityLogging()
400 raidPtr->parityLogDiskQueue.freeCommonList = NULL; in rf_ConfigureParityLogging()
404 raidPtr); in rf_ConfigureParityLogging()
406 rf_init_mutex2(raidPtr->regionInfo[i].mutex, IPL_VM); in rf_ConfigureParityLogging()
407 rf_init_mutex2(raidPtr->regionInfo[i].reintMutex, IPL_VM); in rf_ConfigureParityLogging()
408 raidPtr->regionInfo[i].reintInProgress = RF_FALSE; in rf_ConfigureParityLogging()
409 raidPtr->regionInfo[i].regionStartAddr = in rf_ConfigureParityLogging()
410 raidPtr->regionLogCapacity * i; in rf_ConfigureParityLogging()
411 raidPtr->regionInfo[i].parityStartAddr = in rf_ConfigureParityLogging()
412 raidPtr->regionParityRange * i; in rf_ConfigureParityLogging()
414 raidPtr->regionInfo[i].capacity = in rf_ConfigureParityLogging()
415 raidPtr->regionLogCapacity; in rf_ConfigureParityLogging()
416 raidPtr->regionInfo[i].numSectorsParity = in rf_ConfigureParityLogging()
417 raidPtr->regionParityRange; in rf_ConfigureParityLogging()
419 raidPtr->regionInfo[i].capacity = in rf_ConfigureParityLogging()
421 raidPtr->regionInfo[i].numSectorsParity = in rf_ConfigureParityLogging()
422 raidPtr->sectorsPerDisk - in rf_ConfigureParityLogging()
423 raidPtr->regionParityRange * i; in rf_ConfigureParityLogging()
424 if (raidPtr->regionInfo[i].numSectorsParity > in rf_ConfigureParityLogging()
427 raidPtr->regionInfo[i].numSectorsParity; in rf_ConfigureParityLogging()
429 raidPtr->regionInfo[i].diskCount = 0; in rf_ConfigureParityLogging()
430 RF_ASSERT(raidPtr->regionInfo[i].capacity + in rf_ConfigureParityLogging()
431 raidPtr->regionInfo[i].regionStartAddr <= in rf_ConfigureParityLogging()
433 RF_ASSERT(raidPtr->regionInfo[i].parityStartAddr + in rf_ConfigureParityLogging()
434 raidPtr->regionInfo[i].numSectorsParity <= in rf_ConfigureParityLogging()
435 raidPtr->sectorsPerDisk); in rf_ConfigureParityLogging()
437 (int) (raidPtr->regionInfo[i].capacity * in rf_ConfigureParityLogging()
439 raidPtr->regionInfo[i].diskMap = RF_Malloc( in rf_ConfigureParityLogging()
440 raidPtr->regionInfo[i].capacity * in rf_ConfigureParityLogging()
441 sizeof(*raidPtr->regionInfo[i].diskMap)); in rf_ConfigureParityLogging()
442 if (raidPtr->regionInfo[i].diskMap == NULL) { in rf_ConfigureParityLogging()
444 FreeRegionInfo(raidPtr, j); in rf_ConfigureParityLogging()
445 RF_Free(raidPtr->regionInfo, in rf_ConfigureParityLogging()
450 raidPtr->regionInfo[i].loggingEnabled = RF_FALSE; in rf_ConfigureParityLogging()
451 raidPtr->regionInfo[i].coreLog = NULL; in rf_ConfigureParityLogging()
455 raidPtr); in rf_ConfigureParityLogging()
456 RF_ASSERT(raidPtr->parityLogDiskQueue.threadState == 0); in rf_ConfigureParityLogging()
457 raidPtr->parityLogDiskQueue.threadState = RF_PLOG_CREATED; in rf_ConfigureParityLogging()
458 rc = RF_CREATE_THREAD(raidPtr->pLogDiskThreadHandle, in rf_ConfigureParityLogging()
459 rf_ParityLoggingDiskManager, raidPtr,"rf_log"); in rf_ConfigureParityLogging()
461 raidPtr->parityLogDiskQueue.threadState = 0; in rf_ConfigureParityLogging()
467 rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ConfigureParityLogging()
468 while (!(raidPtr->parityLogDiskQueue.threadState & RF_PLOG_RUNNING)) { in rf_ConfigureParityLogging()
469 rf_wait_cond2(raidPtr->parityLogDiskQueue.cond, in rf_ConfigureParityLogging()
470 raidPtr->parityLogDiskQueue.mutex); in rf_ConfigureParityLogging()
472 rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ConfigureParityLogging()
474 rf_ShutdownCreate(listp, rf_ShutdownParityLogging, raidPtr); in rf_ConfigureParityLogging()
479 … nominal sectors of log per parity region is %d\n", (int) raidPtr->regionLogCapacit… in rf_ConfigureParityLogging()
481 printf(" total number of parity logs is %d\n", raidPtr->numParityLogs); in rf_ConfigureParityLogging()
482 printf(" parity log size is %d sectors\n", raidPtr->numSectorsPerLog); in rf_ConfigureParityLogging()
485 rf_EnableParityLogging(raidPtr); in rf_ConfigureParityLogging()
492 RF_Raid_t * raidPtr, in FreeRegionInfo() argument
495 RF_Free(raidPtr->regionInfo[regionID].diskMap, in FreeRegionInfo()
496 (raidPtr->regionInfo[regionID].capacity * in FreeRegionInfo()
498 if (!rf_forceParityLogReint && raidPtr->regionInfo[regionID].coreLog) { in FreeRegionInfo()
499 rf_ReleaseParityLogs(raidPtr, in FreeRegionInfo()
500 raidPtr->regionInfo[regionID].coreLog); in FreeRegionInfo()
501 raidPtr->regionInfo[regionID].coreLog = NULL; in FreeRegionInfo()
503 RF_ASSERT(raidPtr->regionInfo[regionID].coreLog == NULL); in FreeRegionInfo()
504 RF_ASSERT(raidPtr->regionInfo[regionID].diskCount == 0); in FreeRegionInfo()
506 rf_destroy_mutex2(raidPtr->regionInfo[regionID].reintMutex); in FreeRegionInfo()
507 rf_destroy_mutex2(raidPtr->regionInfo[regionID].mutex); in FreeRegionInfo()
512 FreeParityLogQueue(RF_Raid_t * raidPtr) in FreeParityLogQueue() argument
516 l1 = raidPtr->parityLogPool.parityLogs; in FreeParityLogQueue()
520 RF_Free(l2->records, (raidPtr->numSectorsPerLog * in FreeParityLogQueue()
524 rf_destroy_mutex2(raidPtr->parityLogPool.mutex); in FreeParityLogQueue()
547 RF_Raid_t *raidPtr; in rf_ShutdownParityLoggingRegionInfo() local
550 raidPtr = (RF_Raid_t *) arg; in rf_ShutdownParityLoggingRegionInfo()
553 raidPtr->raidid); in rf_ShutdownParityLoggingRegionInfo()
557 FreeRegionInfo(raidPtr, i); in rf_ShutdownParityLoggingRegionInfo()
558 RF_Free(raidPtr->regionInfo, (rf_numParityRegions * in rf_ShutdownParityLoggingRegionInfo()
559 sizeof(raidPtr->regionInfo))); in rf_ShutdownParityLoggingRegionInfo()
560 raidPtr->regionInfo = NULL; in rf_ShutdownParityLoggingRegionInfo()
566 RF_Raid_t *raidPtr; in rf_ShutdownParityLoggingPool() local
568 raidPtr = (RF_Raid_t *) arg; in rf_ShutdownParityLoggingPool()
570 printf("raid%d: ShutdownParityLoggingPool\n", raidPtr->raidid); in rf_ShutdownParityLoggingPool()
573 FreeParityLogQueue(raidPtr); in rf_ShutdownParityLoggingPool()
574 RF_Free(raidPtr->parityLogBufferHeap, raidPtr->numParityLogs * in rf_ShutdownParityLoggingPool()
575 raidPtr->numSectorsPerLog * raidPtr->bytesPerSector); in rf_ShutdownParityLoggingPool()
581 RF_Raid_t *raidPtr; in rf_ShutdownParityLoggingRegionBufferPool() local
583 raidPtr = (RF_Raid_t *) arg; in rf_ShutdownParityLoggingRegionBufferPool()
586 raidPtr->raidid); in rf_ShutdownParityLoggingRegionBufferPool()
588 FreeRegionBufferQueue(&raidPtr->regionBufferPool); in rf_ShutdownParityLoggingRegionBufferPool()
594 RF_Raid_t *raidPtr; in rf_ShutdownParityLoggingParityBufferPool() local
596 raidPtr = (RF_Raid_t *) arg; in rf_ShutdownParityLoggingParityBufferPool()
599 raidPtr->raidid); in rf_ShutdownParityLoggingParityBufferPool()
601 FreeRegionBufferQueue(&raidPtr->parityBufferPool); in rf_ShutdownParityLoggingParityBufferPool()
609 RF_Raid_t *raidPtr; in rf_ShutdownParityLoggingDiskQueue() local
611 raidPtr = (RF_Raid_t *) arg; in rf_ShutdownParityLoggingDiskQueue()
614 raidPtr->raidid); in rf_ShutdownParityLoggingDiskQueue()
617 RF_ASSERT(raidPtr->parityLogDiskQueue.bufHead == NULL); in rf_ShutdownParityLoggingDiskQueue()
618 RF_ASSERT(raidPtr->parityLogDiskQueue.bufTail == NULL); in rf_ShutdownParityLoggingDiskQueue()
619 RF_ASSERT(raidPtr->parityLogDiskQueue.reintHead == NULL); in rf_ShutdownParityLoggingDiskQueue()
620 RF_ASSERT(raidPtr->parityLogDiskQueue.reintTail == NULL); in rf_ShutdownParityLoggingDiskQueue()
621 while (raidPtr->parityLogDiskQueue.freeDataList) { in rf_ShutdownParityLoggingDiskQueue()
622 d = raidPtr->parityLogDiskQueue.freeDataList; in rf_ShutdownParityLoggingDiskQueue()
623 raidPtr->parityLogDiskQueue.freeDataList = in rf_ShutdownParityLoggingDiskQueue()
624 raidPtr->parityLogDiskQueue.freeDataList->next; in rf_ShutdownParityLoggingDiskQueue()
627 while (raidPtr->parityLogDiskQueue.freeCommonList) { in rf_ShutdownParityLoggingDiskQueue()
628 c = raidPtr->parityLogDiskQueue.freeCommonList; in rf_ShutdownParityLoggingDiskQueue()
629 raidPtr->parityLogDiskQueue.freeCommonList = c->next; in rf_ShutdownParityLoggingDiskQueue()
635 rf_destroy_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ShutdownParityLoggingDiskQueue()
636 rf_destroy_cond2(raidPtr->parityLogDiskQueue.cond); in rf_ShutdownParityLoggingDiskQueue()
642 RF_Raid_t *raidPtr; in rf_ShutdownParityLogging() local
644 raidPtr = (RF_Raid_t *) arg; in rf_ShutdownParityLogging()
646 printf("raid%d: ShutdownParityLogging\n", raidPtr->raidid); in rf_ShutdownParityLogging()
653 rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ShutdownParityLogging()
654 raidPtr->parityLogDiskQueue.threadState |= RF_PLOG_TERMINATE; in rf_ShutdownParityLogging()
655 rf_signal_cond2(raidPtr->parityLogDiskQueue.cond); in rf_ShutdownParityLogging()
656 rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ShutdownParityLogging()
661 rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ShutdownParityLogging()
662 while (!(raidPtr->parityLogDiskQueue.threadState & RF_PLOG_SHUTDOWN)) { in rf_ShutdownParityLogging()
663 rf_wait_cond2(raidPtr->parityLogDiskQueue.cond, in rf_ShutdownParityLogging()
664 raidPtr->parityLogDiskQueue.mutex); in rf_ShutdownParityLogging()
666 rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); in rf_ShutdownParityLogging()
668 printf("raid%d: ShutdownParityLogging done (thread completed)\n", raidPtr->raidid); in rf_ShutdownParityLogging()
673 rf_GetDefaultNumFloatingReconBuffersParityLogging(RF_Raid_t * raidPtr) in rf_GetDefaultNumFloatingReconBuffersParityLogging() argument
679 rf_GetDefaultHeadSepLimitParityLogging(RF_Raid_t * raidPtr) in rf_GetDefaultHeadSepLimitParityLogging() argument
686 RF_Raid_t * raidPtr, in rf_MapRegionIDParityLogging() argument
692 regionID = address / raidPtr->regionParityRange; in rf_MapRegionIDParityLogging()
697 RF_ASSERT(address >= raidPtr->regionInfo[regionID].parityStartAddr); in rf_MapRegionIDParityLogging()
698 RF_ASSERT(address < raidPtr->regionInfo[regionID].parityStartAddr + in rf_MapRegionIDParityLogging()
699 raidPtr->regionInfo[regionID].numSectorsParity); in rf_MapRegionIDParityLogging()
708 RF_Raid_t * raidPtr, in rf_MapSectorParityLogging() argument
715 raidPtr->Layout.sectorsPerStripeUnit; in rf_MapSectorParityLogging()
718 *col = SUID % raidPtr->Layout.numDataCol; in rf_MapSectorParityLogging()
719 *diskSector = (SUID / (raidPtr->Layout.numDataCol)) * in rf_MapSectorParityLogging()
720 raidPtr->Layout.sectorsPerStripeUnit + in rf_MapSectorParityLogging()
721 (raidSector % raidPtr->Layout.sectorsPerStripeUnit); in rf_MapSectorParityLogging()
728 RF_Raid_t * raidPtr, in rf_MapParityParityLogging() argument
735 raidPtr->Layout.sectorsPerStripeUnit; in rf_MapParityParityLogging()
740 *col = raidPtr->Layout.numDataCol; in rf_MapParityParityLogging()
741 *diskSector = (SUID / (raidPtr->Layout.numDataCol)) * in rf_MapParityParityLogging()
742 raidPtr->Layout.sectorsPerStripeUnit + in rf_MapParityParityLogging()
743 (raidSector % raidPtr->Layout.sectorsPerStripeUnit); in rf_MapParityParityLogging()
750 RF_Raid_t * raidPtr, in rf_MapLogParityLogging() argument
756 *col = raidPtr->numCol - 1; in rf_MapLogParityLogging()
757 *startSector = raidPtr->regionInfo[regionID].regionStartAddr + regionOffset; in rf_MapLogParityLogging()
765 RF_Raid_t * raidPtr, in rf_MapRegionParity() argument
771 *col = raidPtr->numCol - 2; in rf_MapRegionParity()
772 *startSector = raidPtr->regionInfo[regionID].parityStartAddr; in rf_MapRegionParity()
773 *numSector = raidPtr->regionInfo[regionID].numSectorsParity; in rf_MapRegionParity()
781 RF_Raid_t * raidPtr, in rf_IdentifyStripeParityLogging() argument
785 RF_StripeNum_t stripeID = rf_RaidAddressToStripeID(&raidPtr->Layout, in rf_IdentifyStripeParityLogging()
788 raidPtr->Layout.layoutSpecificInfo; in rf_IdentifyStripeParityLogging()
789 *diskids = info->stripeIdentifier[stripeID % raidPtr->numCol]; in rf_IdentifyStripeParityLogging()
811 RF_Raid_t * raidPtr, in rf_ParityLoggingDagSelect() argument
816 RF_RaidLayout_t *layoutPtr = &(raidPtr->Layout); in rf_ParityLoggingDagSelect()
836 rstat = raidPtr->status; in rf_ParityLoggingDagSelect()
839 rf_CheckRUReconstructed(raidPtr->reconControl->reconMap, failedPDA->startSector) : 0 in rf_ParityLoggingDagSelect()
851 (layoutPtr->map->MapParity) (raidPtr, failedPDA->raidAddress, in rf_ParityLoggingDagSelect()
871 (layoutPtr->map->MapSector) (raidPtr, failedPDA->raidAddress, in rf_ParityLoggingDagSelect()
879 failedPDA->col = raidPtr->Disks[fcol].spareCol; in rf_ParityLoggingDagSelect()
898 raidPtr->raidid, type, oc, (long) oo, failedPDA->col, (long) failedPDA->startSector); in rf_ParityLoggingDagSelect()
926 rf_CheckStripeForFailures(raidPtr, asmp)) { in rf_ParityLoggingDagSelect()