Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe remove the final tsleep/wakeup pair in rai...
details: https://anonhg.NetBSD.org/src/rev/67f5c06ec31c
branches: trunk
changeset: 447352:67f5c06ec31c
user: mrg <mrg%NetBSD.org@localhost>
date: Tue Jan 08 07:18:18 2019 +0000
description:
remove the final tsleep/wakeup pair in raidframe.
diffstat:
sys/dev/raidframe/rf_driver.c | 11 ++++++-----
sys/dev/raidframe/rf_netbsdkintf.c | 8 +++++---
sys/dev/raidframe/rf_raid.h | 3 ++-
3 files changed, 13 insertions(+), 9 deletions(-)
diffs (98 lines):
diff -r 6b8bbbe2e685 -r 67f5c06ec31c sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c Tue Jan 08 06:55:50 2019 +0000
+++ b/sys/dev/raidframe/rf_driver.c Tue Jan 08 07:18:18 2019 +0000
@@ -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 @@
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_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_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 -r 6b8bbbe2e685 -r 67f5c06ec31c sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Tue Jan 08 06:55:50 2019 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Tue Jan 08 07:18:18 2019 +0000
@@ -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 @@
/* 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 -r 6b8bbbe2e685 -r 67f5c06ec31c sys/dev/raidframe/rf_raid.h
--- a/sys/dev/raidframe/rf_raid.h Tue Jan 08 06:55:50 2019 +0000
+++ b/sys/dev/raidframe/rf_raid.h Tue Jan 08 07:18:18 2019 +0000
@@ -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 @@
int copyback_in_progress;
int adding_hot_spare;
+ rf_declare_cond2(parity_rewrite_cv);
rf_declare_cond2(adding_hot_spare_cv);
/*
Home |
Main Index |
Thread Index |
Old Index