diff options
| author | mrg <mrg@NetBSD.org> | 2011-05-02 00:39:37 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2011-05-02 00:39:37 +0000 |
| commit | 152a051ebdd3d06398cb5c8c04cae953c6782396 (patch) | |
| tree | dbf86ff825808992cf7a66c7dec8f8b2e94c39e2 /sys/dev/raidframe | |
| parent | 701ab50f57f4cee417b917611cf9fa175330605a (diff) | |
rever the previous for now; it hangs reconstruction.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.h | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconutil.c | 8 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_revent.c | 24 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_threadstuff.h | 4 |
4 files changed, 19 insertions, 21 deletions
diff --git a/sys/dev/raidframe/rf_reconstruct.h b/sys/dev/raidframe/rf_reconstruct.h index ac616b2046b..ba07dc772e4 100644 --- a/sys/dev/raidframe/rf_reconstruct.h +++ b/sys/dev/raidframe/rf_reconstruct.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.h,v 1.25 2011/05/01 10:01:01 mrg Exp $ */ +/* $NetBSD: rf_reconstruct.h,v 1.26 2011/05/02 00:39:37 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -137,7 +137,7 @@ struct RF_ReconCtrl_s { /* reconstruction event queue */ RF_ReconEvent_t *eventQueue; /* queue of pending reconstruction * events */ - rf_declare_mutex2(eq_mutex); /* mutex for locking event + RF_DECLARE_MUTEX(eq_mutex) /* mutex for locking event * queue */ int eq_count; /* debug only */ diff --git a/sys/dev/raidframe/rf_reconutil.c b/sys/dev/raidframe/rf_reconutil.c index 515fdc4f2b2..870349af74a 100644 --- a/sys/dev/raidframe/rf_reconutil.c +++ b/sys/dev/raidframe/rf_reconutil.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconutil.c,v 1.30 2011/05/01 10:01:01 mrg Exp $ */ +/* $NetBSD: rf_reconutil.c,v 1.31 2011/05/02 00:39:37 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -31,7 +31,7 @@ ********************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.30 2011/05/01 10:01:01 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.31 2011/05/02 00:39:37 mrg Exp $"); #include <dev/raidframe/raidframevar.h> @@ -125,7 +125,7 @@ rf_MakeReconControl(RF_RaidReconDesc_t *reconDesc, } /* initialize the event queue */ - rf_init_mutex2(reconCtrlPtr->eq_mutex, IPL_VM); + rf_mutex_init(&reconCtrlPtr->eq_mutex); reconCtrlPtr->eventQueue = NULL; reconCtrlPtr->eq_count = 0; @@ -171,8 +171,6 @@ rf_FreeReconControl(RF_Raid_t *raidPtr) t = reconCtrlPtr->floatingRbufs; } - rf_destroy_mutex2(reconCtrlPtr->eq_mutex); - rf_FreeReconMap(reconCtrlPtr->reconMap); rf_FreeParityStripeStatusTable(raidPtr, reconCtrlPtr->pssTable); RF_Free(reconCtrlPtr->perDiskInfo, diff --git a/sys/dev/raidframe/rf_revent.c b/sys/dev/raidframe/rf_revent.c index 911c2abbde4..eaf5e9c31e9 100644 --- a/sys/dev/raidframe/rf_revent.c +++ b/sys/dev/raidframe/rf_revent.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_revent.c,v 1.26 2011/05/01 10:01:01 mrg Exp $ */ +/* $NetBSD: rf_revent.c,v 1.27 2011/05/02 00:39:37 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.26 2011/05/01 10:01:01 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_revent.c,v 1.27 2011/05/02 00:39:37 mrg Exp $"); #include <sys/errno.h> @@ -81,7 +81,7 @@ rf_GetNextReconEvent(RF_RaidReconDesc_t *reconDesc) RF_ReconEvent_t *event; int stall_count; - rf_lock_mutex2(rctrl->eq_mutex); + RF_LOCK_MUTEX(rctrl->eq_mutex); /* q null and count==0 must be equivalent conditions */ RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0)); @@ -114,8 +114,9 @@ rf_GetNextReconEvent(RF_RaidReconDesc_t *reconDesc) reconDesc->numReconExecDelays++; #endif /* RF_RECON_STATS > 0 */ - status = rf_sleep("rfrecond", RECON_TIMO, - rctrl->eq_mutex); + status = ltsleep(&reconDesc->reconExecTicks, PRIBIO, + "recon delay", RECON_TIMO, + &rctrl->eq_mutex); RF_ASSERT(status == EWOULDBLOCK); reconDesc->reconExecTicks = 0; } @@ -127,7 +128,8 @@ rf_GetNextReconEvent(RF_RaidReconDesc_t *reconDesc) reconDesc->numReconEventWaits++; #endif /* RF_RECON_STATS > 0 */ - rf_sleep("rfevq", RF_EVENTQ_WAIT, rctrl->eq_mutex); + ltsleep(&(rctrl)->eventQueue, PRIBIO, "raidframe eventq", + RF_EVENTQ_WAIT, &((rctrl)->eq_mutex)); stall_count++; @@ -153,7 +155,7 @@ rf_GetNextReconEvent(RF_RaidReconDesc_t *reconDesc) /* q null and count==0 must be equivalent conditions */ RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0)); - rf_unlock_mutex2(rctrl->eq_mutex); + RF_UNLOCK_MUTEX(rctrl->eq_mutex); return (event); } /* enqueues a reconstruction event on the indicated queue */ @@ -168,13 +170,13 @@ rf_CauseReconEvent(RF_Raid_t *raidPtr, RF_RowCol_t col, void *arg, RF_ASSERT(col != rctrl->fcol); } RF_ASSERT(col >= 0 && col <= raidPtr->numCol); - rf_lock_mutex2(rctrl->eq_mutex); + RF_LOCK_MUTEX(rctrl->eq_mutex); /* q null and count==0 must be equivalent conditions */ RF_ASSERT((rctrl->eventQueue == NULL) == (rctrl->eq_count == 0)); event->next = rctrl->eventQueue; rctrl->eventQueue = event; rctrl->eq_count++; - rf_unlock_mutex2(rctrl->eq_mutex); + RF_UNLOCK_MUTEX(rctrl->eq_mutex); wakeup(&(rctrl)->eventQueue); } @@ -204,7 +206,7 @@ rf_DrainReconEventQueue(RF_RaidReconDesc_t *reconDesc) RF_ReconCtrl_t *rctrl = reconDesc->raidPtr->reconControl; RF_ReconEvent_t *event; - rf_lock_mutex2(rctrl->eq_mutex); + RF_LOCK_MUTEX(rctrl->eq_mutex); while (rctrl->eventQueue!=NULL) { event = rctrl->eventQueue; @@ -214,7 +216,7 @@ rf_DrainReconEventQueue(RF_RaidReconDesc_t *reconDesc) /* dump it */ rf_FreeReconEventDesc(event); } - rf_unlock_mutex2(rctrl->eq_mutex); + RF_UNLOCK_MUTEX(rctrl->eq_mutex); } void diff --git a/sys/dev/raidframe/rf_threadstuff.h b/sys/dev/raidframe/rf_threadstuff.h index 6a646c3f9aa..ecbd710da00 100644 --- a/sys/dev/raidframe/rf_threadstuff.h +++ b/sys/dev/raidframe/rf_threadstuff.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_threadstuff.h,v 1.27 2011/05/01 10:01:01 mrg Exp $ */ +/* $NetBSD: rf_threadstuff.h,v 1.28 2011/05/02 00:39:37 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -91,8 +91,6 @@ typedef void *RF_ThreadArg_t; #define rf_signal_cond2(_c_) cv_signal(&(_c_)) #define rf_broadcast_cond2(_c_) cv_broadcast(&(_c_)) -#define rf_sleep(_w_,_t_,_m_) kpause((_w_), false, (_t_), &(_m_)) - /* * In NetBSD, kernel threads are simply processes which share several * substructures and never run in userspace. |
