diff options
| author | mrg <mrg@NetBSD.org> | 2011-05-11 03:38:32 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2011-05-11 03:38:32 +0000 |
| commit | 56e2bbfb90c6492a6a284cd51cada6e93341c62b (patch) | |
| tree | c5cd44f6cc58ffe637bf51757a36af48a8f70a0f /sys/dev/raidframe | |
| parent | 0816fdbf4b0f187a7e3223fed00742d3b3b55739 (diff) | |
convert reintMutex to a kmutex.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_paritylog.c | 18 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_paritylog.h | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_paritylogDiskMgr.c | 8 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_paritylogging.c | 7 |
4 files changed, 19 insertions, 18 deletions
diff --git a/sys/dev/raidframe/rf_paritylog.c b/sys/dev/raidframe/rf_paritylog.c index 95d1633c78f..f1c64aa8a84 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.15 2011/05/11 03:23:26 mrg Exp $ */ +/* $NetBSD: rf_paritylog.c,v 1.16 2011/05/11 03:38:32 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.15 2011/05/11 03:23:26 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritylog.c,v 1.16 2011/05/11 03:38:32 mrg Exp $"); #include "rf_archs.h" @@ -548,7 +548,7 @@ ReintLog( * specified region (regionID) to indicate that reintegration is in * progress for this region. NON-BLOCKING */ - RF_LOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_lock_mutex2(raidPtr->regionInfo[regionID].reintMutex); raidPtr->regionInfo[regionID].reintInProgress = RF_TRUE; /* cleared when reint * complete */ @@ -558,7 +558,7 @@ ReintLog( rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); log->next = raidPtr->parityLogDiskQueue.reintQueue; raidPtr->parityLogDiskQueue.reintQueue = log; - RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_unlock_mutex2(raidPtr->regionInfo[regionID].reintMutex); rf_signal_cond2(raidPtr->parityLogDiskQueue.cond); rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); } @@ -612,7 +612,7 @@ DumpParityLogToDisk( RF_ASSERT(log->next == NULL); /* if reintegration is in progress, must queue work */ - RF_LOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_lock_mutex2(raidPtr->regionInfo[regionID].reintMutex); if (raidPtr->regionInfo[regionID].reintInProgress) { /* Can not proceed since this region is currently being * reintegrated. We can not block, so queue remaining work and @@ -625,10 +625,10 @@ DumpParityLogToDisk( RequeueParityLogData(logData, &raidPtr->parityLogDiskQueue.reintBlockHead, &raidPtr->parityLogDiskQueue.reintBlockTail); else EnqueueParityLogData(logData, &raidPtr->parityLogDiskQueue.reintBlockHead, &raidPtr->parityLogDiskQueue.reintBlockTail); - RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_unlock_mutex2(raidPtr->regionInfo[regionID].reintMutex); return (1); /* relenquish control of this thread */ } - RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_unlock_mutex2(raidPtr->regionInfo[regionID].reintMutex); raidPtr->regionInfo[regionID].coreLog = NULL; if ((raidPtr->regionInfo[regionID].diskCount) < raidPtr->regionInfo[regionID].capacity) /* IMPORTANT!! this loop bound assumes region disk holds an @@ -695,13 +695,13 @@ rf_ParityLogAppend( if (clearReintFlag) { /* Enable flushing for this region. Holding both locks * provides a synchronization barrier with DumpParityLogToDisk */ - RF_LOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_lock_mutex2(raidPtr->regionInfo[regionID].reintMutex); /* XXXmrg need this? */ rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); RF_ASSERT(raidPtr->regionInfo[regionID].reintInProgress == RF_TRUE); raidPtr->regionInfo[regionID].diskCount = 0; raidPtr->regionInfo[regionID].reintInProgress = RF_FALSE; - RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); /* flushing is now + rf_unlock_mutex2(raidPtr->regionInfo[regionID].reintMutex); /* flushing is now * enabled */ /* XXXmrg need this? */ rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); diff --git a/sys/dev/raidframe/rf_paritylog.h b/sys/dev/raidframe/rf_paritylog.h index 9f3c347c8a8..ac7977657db 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.7 2011/05/11 03:23:26 mrg Exp $ */ +/* $NetBSD: rf_paritylog.h,v 1.8 2011/05/11 03:38:32 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -146,7 +146,7 @@ struct RF_DiskMap_s { struct RF_RegionInfo_s { RF_DECLARE_MUTEX(mutex) /* protects: diskCount, diskMap, * loggingEnabled, coreLog */ - RF_DECLARE_MUTEX(reintMutex) /* protects: reintInProgress */ + rf_declare_mutex2(reintMutex); /* protects: reintInProgress */ int reintInProgress;/* flag used to suspend flushing operations */ RF_SectorCount_t capacity; /* capacity of this region in sectors */ RF_SectorNum_t regionStartAddr; /* starting disk address for this diff --git a/sys/dev/raidframe/rf_paritylogDiskMgr.c b/sys/dev/raidframe/rf_paritylogDiskMgr.c index 5d3ca570c5b..87ef2eb71f7 100644 --- a/sys/dev/raidframe/rf_paritylogDiskMgr.c +++ b/sys/dev/raidframe/rf_paritylogDiskMgr.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_paritylogDiskMgr.c,v 1.25 2011/05/11 03:23:26 mrg Exp $ */ +/* $NetBSD: rf_paritylogDiskMgr.c,v 1.26 2011/05/11 03:38:32 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_paritylogDiskMgr.c,v 1.25 2011/05/11 03:23:26 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritylogDiskMgr.c,v 1.26 2011/05/11 03:38:32 mrg Exp $"); #include "rf_archs.h" @@ -535,13 +535,13 @@ ReintegrateLogs( * locks provides a synchronization barrier with * DumpParityLogToDisk */ RF_LOCK_MUTEX(raidPtr->regionInfo[regionID].mutex); - RF_LOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); + rf_lock_mutex2(raidPtr->regionInfo[regionID].reintMutex); /* XXXmrg: don't need this? */ rf_lock_mutex2(raidPtr->parityLogDiskQueue.mutex); raidPtr->regionInfo[regionID].diskCount = 0; raidPtr->regionInfo[regionID].reintInProgress = RF_FALSE; RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].mutex); - RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].reintMutex); /* flushing is now + rf_unlock_mutex2(raidPtr->regionInfo[regionID].reintMutex); /* flushing is now * enabled */ /* XXXmrg: don't need this? */ rf_unlock_mutex2(raidPtr->parityLogDiskQueue.mutex); diff --git a/sys/dev/raidframe/rf_paritylogging.c b/sys/dev/raidframe/rf_paritylogging.c index 62098517226..f0227b171eb 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.30 2011/05/11 03:23:26 mrg Exp $ */ +/* $NetBSD: rf_paritylogging.c,v 1.31 2011/05/11 03:38:32 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.30 2011/05/11 03:23:26 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.31 2011/05/11 03:38:32 mrg Exp $"); #include "rf_archs.h" @@ -411,7 +411,7 @@ rf_ConfigureParityLogging( raidPtr); for (i = 0; i < rf_numParityRegions; i++) { rf_mutex_init(&raidPtr->regionInfo[i].mutex); - rf_mutex_init(&raidPtr->regionInfo[i].reintMutex); + rf_init_mutex2(raidPtr->regionInfo[i].reintMutex, IPL_VM); raidPtr->regionInfo[i].reintInProgress = RF_FALSE; raidPtr->regionInfo[i].regionStartAddr = raidPtr->regionLogCapacity * i; @@ -513,6 +513,7 @@ FreeRegionInfo( RF_ASSERT(raidPtr->regionInfo[regionID].diskCount == 0); } RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].mutex); + rf_destroy_mutex2(raidPtr->regionInfo[regionID].reintMutex); } |
