Module Name: src
Committed By: mrg
Date: Tue Jan 8 07:18:18 UTC 2019
Modified Files:
src/sys/dev/raidframe: rf_driver.c rf_netbsdkintf.c rf_raid.h
Log Message:
remove the final tsleep/wakeup pair in raidframe.
To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/dev/raidframe/rf_driver.c
cvs rdiff -u -r1.356 -r1.357 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/raidframe/rf_raid.h
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_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.133 src/sys/dev/raidframe/rf_driver.c:1.134
--- src/sys/dev/raidframe/rf_driver.c:1.133 Sat Dec 10 23:03:27 2016
+++ src/sys/dev/raidframe/rf_driver.c Tue Jan 8 07:18:18 2019
@@ -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);
Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.356 src/sys/dev/raidframe/rf_netbsdkintf.c:1.357
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.356 Tue Jan 23 22:42:29 2018
+++ src/sys/dev/raidframe/rf_netbsdkintf.c Tue Jan 8 07:18:18 2019
@@ -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 *raidPt
/* 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... */
Index: src/sys/dev/raidframe/rf_raid.h
diff -u src/sys/dev/raidframe/rf_raid.h:1.45 src/sys/dev/raidframe/rf_raid.h:1.46
--- src/sys/dev/raidframe/rf_raid.h:1.45 Sat Oct 18 08:33:28 2014
+++ src/sys/dev/raidframe/rf_raid.h Tue Jan 8 07:18:18 2019
@@ -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);
/*