Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe rf_lkmgr_mutex_init() is only called from ...



details:   https://anonhg.NetBSD.org/src/rev/f8a9d53f3476
branches:  trunk
changeset: 556870:f8a9d53f3476
user:      oster <oster%NetBSD.org@localhost>
date:      Mon Dec 29 06:30:42 2003 +0000

description:
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:

 sys/dev/raidframe/rf_driver.c      |  14 ++++----------
 sys/dev/raidframe/rf_threadstuff.c |  11 ++---------
 sys/dev/raidframe/rf_threadstuff.h |  14 ++------------
 3 files changed, 8 insertions(+), 31 deletions(-)

diffs (115 lines):

diff -r d078ca9efcf0 -r f8a9d53f3476 sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c     Mon Dec 29 06:26:41 2003 +0000
+++ b/sys/dev/raidframe/rf_driver.c     Mon Dec 29 06:30:42 2003 +0000
@@ -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 @@
 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 -r d078ca9efcf0 -r f8a9d53f3476 sys/dev/raidframe/rf_threadstuff.c
--- a/sys/dev/raidframe/rf_threadstuff.c        Mon Dec 29 06:26:41 2003 +0000
+++ b/sys/dev/raidframe/rf_threadstuff.c        Mon Dec 29 06:30:42 2003 +0000
@@ -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
  */
-int
-rf_lkmgr_mutex_init(m)
-decl_lock_data(, *m)
-{
-       lockinit(m,PRIBIO,"RAIDframe lock",0,0);
-       return(0);
-}
 
 #if 0
 int
diff -r d078ca9efcf0 -r f8a9d53f3476 sys/dev/raidframe/rf_threadstuff.h
--- a/sys/dev/raidframe/rf_threadstuff.h        Mon Dec 29 06:26:41 2003 +0000
+++ b/sys/dev/raidframe/rf_threadstuff.h        Mon Dec 29 06:30:42 2003 +0000
@@ -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 @@
 #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 @@
 
 #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_ */



Home | Main Index | Thread Index | Old Index