summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2019-01-08 07:18:18 +0000
committermrg <mrg@NetBSD.org>2019-01-08 07:18:18 +0000
commit0cdc9176068683552c7237b96ada98e407aa9601 (patch)
tree18776c5267a615eb759458fa32095f5a6d4f9cfe /sys/dev/raidframe
parentdf79bf43e509d20b2a78f5167eebeffbdb6b8a08 (diff)
remove the final tsleep/wakeup pair in raidframe.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_driver.c11
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c8
-rw-r--r--sys/dev/raidframe/rf_raid.h3
3 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c
index 77bdec0c566..e6958687d2b 100644
--- a/sys/dev/raidframe/rf_driver.c
+++ b/sys/dev/raidframe/rf_driver.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_driver.c,v 1.133 2016/12/10 23:03:27 maya Exp $ */
+/* $NetBSD: rf_driver.c,v 1.134 2019/01/08 07:18:18 mrg Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -66,7 +66,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.133 2016/12/10 23:03:27 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.134 2019/01/08 07:18:18 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_diagnostic.h"
@@ -227,15 +227,14 @@ rf_Shutdown(RF_Raid_t *raidPtr)
while (raidPtr->nAccOutstanding) {
rf_wait_cond2(raidPtr->outstandingCond, raidPtr->rad_lock);
}
- rf_unlock_mutex2(raidPtr->rad_lock);
/* Wait for any parity re-writes to stop... */
while (raidPtr->parity_rewrite_in_progress) {
printf("raid%d: Waiting for parity re-write to exit...\n",
raidPtr->raidid);
- tsleep(&raidPtr->parity_rewrite_in_progress, PRIBIO,
- "rfprwshutdown", 0);
+ rf_wait_cond2(raidPtr->parity_rewrite_cv, raidPtr->rad_lock);
}
+ rf_unlock_mutex2(raidPtr->rad_lock);
/* Wait for any reconstruction to stop... */
rf_lock_mutex2(raidPtr->mutex);
@@ -918,6 +917,7 @@ rf_alloc_mutex_cond(RF_Raid_t *raidPtr)
rf_init_mutex2(raidPtr->mutex, IPL_VM);
rf_init_cond2(raidPtr->outstandingCond, "rfocond");
+ rf_init_cond2(raidPtr->parity_rewrite_cv, "rfprwshutdown");
rf_init_mutex2(raidPtr->rad_lock, IPL_VM);
rf_init_mutex2(raidPtr->access_suspend_mutex, IPL_VM);
@@ -938,6 +938,7 @@ rf_destroy_mutex_cond(RF_Raid_t *raidPtr)
rf_destroy_mutex2(raidPtr->access_suspend_mutex);
rf_destroy_cond2(raidPtr->access_suspend_cv);
+ rf_destroy_cond2(raidPtr->parity_rewrite_cv);
rf_destroy_cond2(raidPtr->outstandingCond);
rf_destroy_mutex2(raidPtr->rad_lock);
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index c3d83478a47..67182036a93 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.356 2018/01/23 22:42:29 pgoyette Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.357 2019/01/08 07:18:18 mrg Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.356 2018/01/23 22:42:29 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.357 2019/01/08 07:18:18 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -2683,7 +2683,9 @@ rf_RewriteParityThread(RF_Raid_t *raidPtr)
/* Anyone waiting for us to stop? If so, inform them... */
if (raidPtr->waitShutdown) {
- wakeup(&raidPtr->parity_rewrite_in_progress);
+ rf_lock_mutex2(raidPtr->rad_lock);
+ cv_broadcast(&raidPtr->parity_rewrite_cv);
+ rf_unlock_mutex2(raidPtr->rad_lock);
}
/* That's all... */
diff --git a/sys/dev/raidframe/rf_raid.h b/sys/dev/raidframe/rf_raid.h
index e4db205a809..6db156257e7 100644
--- a/sys/dev/raidframe/rf_raid.h
+++ b/sys/dev/raidframe/rf_raid.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raid.h,v 1.45 2014/10/18 08:33:28 snj Exp $ */
+/* $NetBSD: rf_raid.h,v 1.46 2019/01/08 07:18:18 mrg Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -214,6 +214,7 @@ struct RF_Raid_s {
int copyback_in_progress;
int adding_hot_spare;
+ rf_declare_cond2(parity_rewrite_cv);
rf_declare_cond2(adding_hot_spare_cv);
/*