Module Name: src
Committed By: mrg
Date: Thu May 5 06:04:09 UTC 2011
Modified Files:
src/sys/dev/raidframe: rf_diskqueue.c rf_diskqueue.h
Log Message:
convert the diskqueue mutex into a kmutex
To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/raidframe/rf_diskqueue.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/raidframe/rf_diskqueue.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_diskqueue.c
diff -u src/sys/dev/raidframe/rf_diskqueue.c:1.52 src/sys/dev/raidframe/rf_diskqueue.c:1.53
--- src/sys/dev/raidframe/rf_diskqueue.c:1.52 Mon Mar 23 18:38:54 2009
+++ src/sys/dev/raidframe/rf_diskqueue.c Thu May 5 06:04:09 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_diskqueue.c,v 1.52 2009/03/23 18:38:54 oster Exp $ */
+/* $NetBSD: rf_diskqueue.c,v 1.53 2011/05/05 06:04:09 mrg Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -66,7 +66,7 @@
****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.52 2009/03/23 18:38:54 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.53 2011/05/05 06:04:09 mrg Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -154,6 +154,14 @@
/* configures a single disk queue */
+static void
+rf_ShutdownDiskQueue(void *arg)
+{
+ RF_DiskQueue_t *diskqueue = arg;
+
+ rf_destroy_mutex2(diskqueue->mutex);
+}
+
int
rf_ConfigureDiskQueue(RF_Raid_t *raidPtr, RF_DiskQueue_t *diskqueue,
RF_RowCol_t c, const RF_DiskQueueSW_t *p,
@@ -172,8 +180,8 @@
diskqueue->flags = 0;
diskqueue->raidPtr = raidPtr;
diskqueue->rf_cinfo = &raidPtr->raid_cinfo[c];
- rf_mutex_init(&diskqueue->mutex);
- diskqueue->cond = 0;
+ rf_init_mutex2(diskqueue->mutex, IPL_VM);
+ rf_ShutdownCreate(listp, rf_ShutdownDiskQueue, diskqueue);
return (0);
}
Index: src/sys/dev/raidframe/rf_diskqueue.h
diff -u src/sys/dev/raidframe/rf_diskqueue.h:1.23 src/sys/dev/raidframe/rf_diskqueue.h:1.24
--- src/sys/dev/raidframe/rf_diskqueue.h:1.23 Mon Mar 23 18:38:54 2009
+++ src/sys/dev/raidframe/rf_diskqueue.h Thu May 5 06:04:09 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_diskqueue.h,v 1.23 2009/03/23 18:38:54 oster Exp $ */
+/* $NetBSD: rf_diskqueue.h,v 1.24 2011/05/05 06:04:09 mrg Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -102,9 +102,7 @@
struct RF_DiskQueue_s {
const RF_DiskQueueSW_t *qPtr; /* access point to queue functions */
void *qHdr; /* queue header, of whatever type */
- RF_DECLARE_MUTEX(mutex) /* mutex locking data structures */
- RF_DECLARE_COND(cond) /* condition variable for
- * synchronization */
+ rf_declare_mutex2(mutex);/* mutex locking data structures */
long numOutstanding; /* number of I/Os currently outstanding on
* disk */
long maxOutstanding; /* max # of I/Os that can be outstanding on a
@@ -127,8 +125,8 @@
#define RF_QUEUE_EMPTY(_q) ((_q)->numOutstanding == 0)
#define RF_QUEUE_FULL(_q) ((_q)->numOutstanding == (_q)->maxOutstanding)
-#define RF_LOCK_QUEUE_MUTEX(_q_,_wh_) RF_LOCK_MUTEX((_q_)->mutex)
-#define RF_UNLOCK_QUEUE_MUTEX(_q_,_wh_) RF_UNLOCK_MUTEX((_q_)->mutex)
+#define RF_LOCK_QUEUE_MUTEX(_q_,_wh_) rf_lock_mutex2((_q_)->mutex)
+#define RF_UNLOCK_QUEUE_MUTEX(_q_,_wh_) rf_unlock_mutex2((_q_)->mutex)
/* whether it is ok to dispatch a regular request */
#define RF_OK_TO_DISPATCH(_q_,_r_) \