Module Name: src Committed By: mrg Date: Wed May 11 03:38:32 UTC 2011
Modified Files: src/sys/dev/raidframe: rf_paritylog.c rf_paritylog.h rf_paritylogDiskMgr.c rf_paritylogging.c Log Message: convert reintMutex to a kmutex. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/raidframe/rf_paritylog.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/raidframe/rf_paritylog.h cvs rdiff -u -r1.25 -r1.26 src/sys/dev/raidframe/rf_paritylogDiskMgr.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/raidframe/rf_paritylogging.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/raidframe/rf_paritylog.c diff -u src/sys/dev/raidframe/rf_paritylog.c:1.15 src/sys/dev/raidframe/rf_paritylog.c:1.16 --- src/sys/dev/raidframe/rf_paritylog.c:1.15 Wed May 11 03:23:26 2011 +++ src/sys/dev/raidframe/rf_paritylog.c Wed May 11 03:38:32 2011 @@ -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 @@ * 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 @@ 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 @@ 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 @@ 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 @@ 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); Index: src/sys/dev/raidframe/rf_paritylog.h diff -u src/sys/dev/raidframe/rf_paritylog.h:1.7 src/sys/dev/raidframe/rf_paritylog.h:1.8 --- src/sys/dev/raidframe/rf_paritylog.h:1.7 Wed May 11 03:23:26 2011 +++ src/sys/dev/raidframe/rf_paritylog.h Wed May 11 03:38:32 2011 @@ -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_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 Index: src/sys/dev/raidframe/rf_paritylogDiskMgr.c diff -u src/sys/dev/raidframe/rf_paritylogDiskMgr.c:1.25 src/sys/dev/raidframe/rf_paritylogDiskMgr.c:1.26 --- src/sys/dev/raidframe/rf_paritylogDiskMgr.c:1.25 Wed May 11 03:23:26 2011 +++ src/sys/dev/raidframe/rf_paritylogDiskMgr.c Wed May 11 03:38:32 2011 @@ -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 @@ * 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); Index: src/sys/dev/raidframe/rf_paritylogging.c diff -u src/sys/dev/raidframe/rf_paritylogging.c:1.30 src/sys/dev/raidframe/rf_paritylogging.c:1.31 --- src/sys/dev/raidframe/rf_paritylogging.c:1.30 Wed May 11 03:23:26 2011 +++ src/sys/dev/raidframe/rf_paritylogging.c Wed May 11 03:38:32 2011 @@ -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 @@ 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 @@ RF_ASSERT(raidPtr->regionInfo[regionID].diskCount == 0); } RF_UNLOCK_MUTEX(raidPtr->regionInfo[regionID].mutex); + rf_destroy_mutex2(raidPtr->regionInfo[regionID].reintMutex); }