Module Name:    src
Committed By:   mrg
Date:           Sun May  1 06:22:54 UTC 2011

Modified Files:
        src/sys/dev/raidframe: rf_acctrace.c rf_acctrace.h rf_netbsdkintf.c

Log Message:
convert rf_tracing_mutex to a kmutex.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/raidframe/rf_acctrace.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/raidframe/rf_acctrace.h
cvs rdiff -u -r1.287 -r1.288 src/sys/dev/raidframe/rf_netbsdkintf.c

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_acctrace.c
diff -u src/sys/dev/raidframe/rf_acctrace.c:1.23 src/sys/dev/raidframe/rf_acctrace.c:1.24
--- src/sys/dev/raidframe/rf_acctrace.c:1.23	Thu Nov 16 01:33:23 2006
+++ src/sys/dev/raidframe/rf_acctrace.c	Sun May  1 06:22:54 2011
@@ -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);
 }
 

Index: src/sys/dev/raidframe/rf_acctrace.h
diff -u src/sys/dev/raidframe/rf_acctrace.h:1.9 src/sys/dev/raidframe/rf_acctrace.h:1.10
--- src/sys/dev/raidframe/rf_acctrace.h:1.9	Wed Apr 27 07:55:14 2011
+++ src/sys/dev/raidframe/rf_acctrace.h	Sun May  1 06:22:54 2011
@@ -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);

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.287 src/sys/dev/raidframe/rf_netbsdkintf.c:1.288
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.287	Sun May  1 05:44:47 2011
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Sun May  1 06:22:54 2011
@@ -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
 

Reply via email to