diff options
| author | oster <oster@NetBSD.org> | 2003-12-29 06:30:42 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2003-12-29 06:30:42 +0000 |
| commit | ee0afdc3dce8789fad88c8a6353788691d58cd1e (patch) | |
| tree | 86450f4d67ba9af47a63f01d8acc1f39659dcc07 /sys/dev/raidframe | |
| parent | 8a08952e14e530c62a8bcc7d9ccd8f56e48d233b (diff) | |
rf_lkmgr_mutex_init() is only called from one spot, and it really
can't fail. Simplify life in rf_BootRaidframe(), and then nuke
rf_lkmgr_mutex_init(). Cleanup rf_threadstuff.h a bit more too.
rf_threadstuff.c is about to Go Away.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_driver.c | 14 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_threadstuff.c | 11 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_threadstuff.h | 14 |
3 files changed, 8 insertions, 31 deletions
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index ab4193c3e3a..7a697c6733a 100644 --- a/sys/dev/raidframe/rf_driver.c +++ b/sys/dev/raidframe/rf_driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_driver.c,v 1.78 2003/12/29 05:58:34 oster Exp $ */ +/* $NetBSD: rf_driver.c,v 1.79 2003/12/29 06:30:42 oster Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -73,7 +73,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.78 2003/12/29 05:58:34 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.79 2003/12/29 06:30:42 oster Exp $"); #include "opt_raid_diagnostic.h" @@ -162,18 +162,12 @@ static int rf_ConfigureRDFreeList(RF_ShutdownList_t ** listp); int rf_BootRaidframe() { - int rc; if (raidframe_booted) return (EBUSY); raidframe_booted = 1; - - rc = rf_lkmgr_mutex_init(&configureMutex); - if (rc) { - rf_print_unable_to_init_mutex( __FILE__, __LINE__, rc); - RF_PANIC(); - } - configureCount = 0; + lockinit(&configureMutex, PRIBIO, "RAIDframe lock", 0, 0); + configureCount = 0; isconfigged = 0; globalShutdown = NULL; return (0); diff --git a/sys/dev/raidframe/rf_threadstuff.c b/sys/dev/raidframe/rf_threadstuff.c index e4966f5cc0c..864f1e7f18d 100644 --- a/sys/dev/raidframe/rf_threadstuff.c +++ b/sys/dev/raidframe/rf_threadstuff.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_threadstuff.c,v 1.19 2003/12/29 06:19:28 oster Exp $ */ +/* $NetBSD: rf_threadstuff.c,v 1.20 2003/12/29 06:30:42 oster Exp $ */ /* * rf_threadstuff.c */ @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.19 2003/12/29 06:19:28 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.20 2003/12/29 06:30:42 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -41,13 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.19 2003/12/29 06:19:28 oster Ex /* * Kernel */ -int -rf_lkmgr_mutex_init(m) -decl_lock_data(, *m) -{ - lockinit(m,PRIBIO,"RAIDframe lock",0,0); - return(0); -} #if 0 int diff --git a/sys/dev/raidframe/rf_threadstuff.h b/sys/dev/raidframe/rf_threadstuff.h index cc7a2aa4c15..eb593bb93d1 100644 --- a/sys/dev/raidframe/rf_threadstuff.h +++ b/sys/dev/raidframe/rf_threadstuff.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_threadstuff.h,v 1.19 2003/12/29 06:19:28 oster Exp $ */ +/* $NetBSD: rf_threadstuff.h,v 1.20 2003/12/29 06:30:42 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -48,13 +48,11 @@ #include <sys/systm.h> #include <sys/proc.h> #include <sys/kthread.h> +#include <sys/lock.h> #include <dev/raidframe/raidframevar.h> -#include <sys/lock.h> - #define decl_simple_lock_data(a,b) a struct simplelock b; -#define simple_lock_addr(a) ((struct simplelock *)&(a)) typedef struct proc *RF_Thread_t; typedef void *RF_ThreadArg_t; @@ -64,8 +62,6 @@ typedef void *RF_ThreadArg_t; #define RF_DECLARE_EXTERN_MUTEX(_m_) decl_simple_lock_data(extern,(_m_)) #define RF_DECLARE_COND(_c_) int _c_; -#define RF_DECLARE_STATIC_COND(_c_) static int _c_; -#define RF_DECLARE_EXTERN_COND(_c_) extern int _c_; #define RF_LOCK_MUTEX(_m_) simple_lock(&(_m_)) #define RF_UNLOCK_MUTEX(_m_) simple_unlock(&(_m_)) @@ -100,10 +96,4 @@ typedef void *RF_ThreadArg_t; #define rf_mutex_init(m) simple_lock_init(m) -int rf_lkmgr_mutex_init(struct lock *); -int rf_lkmgr_mutex_destroy(struct lock *); -int -_rf_create_managed_lkmgr_mutex(RF_ShutdownList_t **, struct lock *, - char *, int); - #endif /* !_RF__RF_THREADSTUFF_H_ */ |
