diff options
| author | mrg <mrg@NetBSD.org> | 2011-05-11 06:03:06 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2011-05-11 06:03:06 +0000 |
| commit | 7280cc26582c664f35766206804c797e2f00942a (patch) | |
| tree | 7ad4234a9ebf5a85fcb7c4ff90fe7b578aea505f /sys/dev/raidframe | |
| parent | 9046703fdcf9ea0f3c0403a5f305091108434f87 (diff) | |
convert parityLogPool.mutex to a kmutex.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_paritylog.c | 16 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_paritylog.h | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_paritylogging.c | 17 |
3 files changed, 17 insertions, 20 deletions
diff --git a/sys/dev/raidframe/rf_paritylog.c b/sys/dev/raidframe/rf_paritylog.c index 1503d9b83b3..415e0f922cc 100644 --- a/sys/dev/raidframe/rf_paritylog.c +++ b/sys/dev/raidframe/rf_paritylog.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_paritylog.c,v 1.17 2011/05/11 05:14:07 mrg Exp $ */ +/* $NetBSD: rf_paritylog.c,v 1.18 2011/05/11 06:03:06 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.17 2011/05/11 05:14:07 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.18 2011/05/11 06:03:06 mrg Exp $"); #include "rf_archs.h" @@ -436,7 +436,7 @@ AcquireParityLog( /* Grab a log buffer from the pool and return it. If no buffers are * available, return NULL. NON-BLOCKING */ raidPtr = logData->common->raidPtr; - RF_LOCK_MUTEX(raidPtr->parityLogPool.mutex); + rf_lock_mutex2(raidPtr->parityLogPool.mutex); if (raidPtr->parityLogPool.parityLogs) { log = raidPtr->parityLogPool.parityLogs; raidPtr->parityLogPool.parityLogs = raidPtr->parityLogPool.parityLogs->next; @@ -457,7 +457,7 @@ AcquireParityLog( else EnqueueParityLogData(logData, &raidPtr->parityLogDiskQueue.logBlockHead, &raidPtr->parityLogDiskQueue.logBlockTail); } - RF_UNLOCK_MUTEX(raidPtr->parityLogPool.mutex); + rf_unlock_mutex2(raidPtr->parityLogPool.mutex); return (log); } @@ -480,7 +480,7 @@ rf_ReleaseParityLogs( /* Before returning logs to global free list, service all requests * which are blocked on logs. Holding mutexes for parityLogPool and * parityLogDiskQueue forces synchronization with AcquireParityLog(). */ - RF_LOCK_MUTEX(raidPtr->parityLogPool.mutex); + rf_lock_mutex2(raidPtr->parityLogPool.mutex); rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); logDataList = DequeueMatchingLogData(raidPtr, &raidPtr->parityLogDiskQueue.logBlockHead, &raidPtr->parityLogDiskQueue.logBlockTail); log = firstLog; @@ -489,7 +489,7 @@ rf_ReleaseParityLogs( log->numRecords = 0; log->next = NULL; while (logDataList && log) { - RF_UNLOCK_MUTEX(raidPtr->parityLogPool.mutex); + rf_unlock_mutex2(raidPtr->parityLogPool.mutex); rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); rf_ParityLogAppend(logDataList, RF_TRUE, &log, RF_FALSE); if (rf_parityLogDebug) @@ -502,7 +502,7 @@ rf_ReleaseParityLogs( log->next = NULL; } } - RF_LOCK_MUTEX(raidPtr->parityLogPool.mutex); + rf_lock_mutex2(raidPtr->parityLogPool.mutex); rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); if (log) logDataList = DequeueMatchingLogData(raidPtr, &raidPtr->parityLogDiskQueue.logBlockHead, &raidPtr->parityLogDiskQueue.logBlockTail); @@ -531,7 +531,7 @@ rf_ReleaseParityLogs( } RF_ASSERT(cnt + raidPtr->logsInUse == raidPtr->numParityLogs); } - RF_UNLOCK_MUTEX(raidPtr->parityLogPool.mutex); + rf_unlock_mutex2(raidPtr->parityLogPool.mutex); rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); } diff --git a/sys/dev/raidframe/rf_paritylog.h b/sys/dev/raidframe/rf_paritylog.h index e986c81d604..141a6a8428d 100644 --- a/sys/dev/raidframe/rf_paritylog.h +++ b/sys/dev/raidframe/rf_paritylog.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_paritylog.h,v 1.9 2011/05/11 05:14:07 mrg Exp $ */ +/* $NetBSD: rf_paritylog.h,v 1.10 2011/05/11 06:03:06 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -89,7 +89,7 @@ struct RF_ParityLog_s { }; struct RF_ParityLogQueue_s { - RF_DECLARE_MUTEX(mutex) + rf_declare_mutex2(mutex); RF_ParityLog_t *parityLogs; }; diff --git a/sys/dev/raidframe/rf_paritylogging.c b/sys/dev/raidframe/rf_paritylogging.c index f5df1cb48ac..8229031f2b8 100644 --- a/sys/dev/raidframe/rf_paritylogging.c +++ b/sys/dev/raidframe/rf_paritylogging.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_paritylogging.c,v 1.32 2011/05/11 05:14:07 mrg Exp $ */ +/* $NetBSD: rf_paritylogging.c,v 1.33 2011/05/11 06:03:06 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.32 2011/05/11 05:14:07 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.33 2011/05/11 06:03:06 mrg Exp $"); #include "rf_archs.h" @@ -234,7 +234,7 @@ rf_ConfigureParityLogging( if (raidPtr->parityLogBufferHeap == NULL) return (ENOMEM); lHeapPtr = raidPtr->parityLogBufferHeap; - rf_mutex_init(&raidPtr->parityLogPool.mutex); + rf_init_mutex2(raidPtr->parityLogPool.mutex, IPL_VM); for (i = 0; i < raidPtr->numParityLogs; i++) { if (i == 0) { RF_Malloc(raidPtr->parityLogPool.parityLogs, @@ -517,14 +517,11 @@ FreeRegionInfo( static void -FreeParityLogQueue( - RF_Raid_t * raidPtr, - RF_ParityLogQueue_t * queue) +FreeParityLogQueue(RF_Raid_t * raidPtr) { RF_ParityLog_t *l1, *l2; - RF_LOCK_MUTEX(queue->mutex); - l1 = queue->parityLogs; + l1 = raidPtr->parityLogPool.parityLogs; while (l1) { l2 = l1; l1 = l2->next; @@ -532,7 +529,7 @@ FreeParityLogQueue( sizeof(RF_ParityLogRecord_t))); RF_Free(l2, sizeof(RF_ParityLog_t)); } - RF_UNLOCK_MUTEX(queue->mutex); + rf_destroy_mutex2(raidPtr->parityLogPool.mutex); } @@ -581,7 +578,7 @@ rf_ShutdownParityLoggingPool(RF_ThreadArg_t arg) printf("raid%d: ShutdownParityLoggingPool\n", raidPtr->raidid); } /* free contents of parityLogPool */ - FreeParityLogQueue(raidPtr, &raidPtr->parityLogPool); + FreeParityLogQueue(raidPtr); RF_Free(raidPtr->parityLogBufferHeap, raidPtr->numParityLogs * raidPtr->numSectorsPerLog * raidPtr->bytesPerSector); } |
