Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe convert rf_tracing_mutex to a kmutex.



details:   https://anonhg.NetBSD.org/src/rev/5d461f0d641a
branches:  trunk
changeset: 764696:5d461f0d641a
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun May 01 06:22:54 2011 +0000

description:
convert rf_tracing_mutex to a kmutex.

diffstat:

 sys/dev/raidframe/rf_acctrace.c    |  15 +++++++++++----
 sys/dev/raidframe/rf_acctrace.h    |   4 ++--
 sys/dev/raidframe/rf_netbsdkintf.c |   8 ++++----
 3 files changed, 17 insertions(+), 10 deletions(-)

diffs (91 lines):

diff -r a7463a0e849d -r 5d461f0d641a sys/dev/raidframe/rf_acctrace.c
--- a/sys/dev/raidframe/rf_acctrace.c   Sun May 01 05:44:47 2011 +0000
+++ b/sys/dev/raidframe/rf_acctrace.c   Sun May 01 06:22:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_acctrace.c,v 1.23 2006/11/16 01:33:23 christos Exp $        */
+/*     $NetBSD: rf_acctrace.c,v 1.24 2011/05/01 06:22:54 mrg Exp $     */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.23 2006/11/16 01:33:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.24 2011/05/01 06:22:54 mrg Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -52,13 +52,20 @@
 #if RF_ACC_TRACE > 0
 static long numTracesSoFar;
 
-RF_DECLARE_MUTEX(rf_tracing_mutex)
+rf_declare_mutex2(rf_tracing_mutex);
+
+static void
+rf_ShutdownAccessTrace(void *unused)
+{
+       rf_destroy_mutex2(rf_tracing_mutex);
+}
 
 int
 rf_ConfigureAccessTrace(RF_ShutdownList_t **listp)
 {
        numTracesSoFar = 0;
-       rf_mutex_init(&rf_tracing_mutex);
+       rf_init_mutex2(rf_tracing_mutex, IPL_VM);
+       rf_ShutdownCreate(listp, rf_ShutdownAccessTrace, NULL);
        return (0);
 }
 
diff -r a7463a0e849d -r 5d461f0d641a sys/dev/raidframe/rf_acctrace.h
--- a/sys/dev/raidframe/rf_acctrace.h   Sun May 01 05:44:47 2011 +0000
+++ b/sys/dev/raidframe/rf_acctrace.h   Sun May 01 06:22:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_acctrace.h,v 1.9 2011/04/27 07:55:14 mrg Exp $      */
+/*     $NetBSD: rf_acctrace.h,v 1.10 2011/05/01 06:22:54 mrg Exp $     */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -123,7 +123,7 @@
        RF_Hist_t tot_hist[RF_HIST_NUM_BUCKETS];
 }       RF_AccTotals_t;
 
-extern RF_DECLARE_MUTEX(rf_tracing_mutex);
+extern rf_declare_mutex2(rf_tracing_mutex);
 
 
 int     rf_ConfigureAccessTrace(RF_ShutdownList_t ** listp);
diff -r a7463a0e849d -r 5d461f0d641a sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sun May 01 05:44:47 2011 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sun May 01 06:22:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.287 2011/05/01 05:44:47 mrg Exp $ */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.288 2011/05/01 06:22:54 mrg Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.287 2011/05/01 05:44:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.288 2011/05/01 06:22:54 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2175,11 +2175,11 @@
        if (req->tracerec) {
                RF_ETIMER_STOP(req->tracerec->timer);
                RF_ETIMER_EVAL(req->tracerec->timer);
-               RF_LOCK_MUTEX(rf_tracing_mutex);
+               rf_lock_mutex2(rf_tracing_mutex);
                req->tracerec->diskwait_us += RF_ETIMER_VAL_US(req->tracerec->timer);
                req->tracerec->phys_io_us += RF_ETIMER_VAL_US(req->tracerec->timer);
                req->tracerec->num_phys_ios++;
-               RF_UNLOCK_MUTEX(rf_tracing_mutex);
+               rf_unlock_mutex2(rf_tracing_mutex);
        }
 #endif
 



Home | Main Index | Thread Index | Old Index