Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe cond_destroyer joins mutex_destroyer in th...



details:   https://anonhg.NetBSD.org/src/rev/af5047373aeb
branches:  trunk
changeset: 556864:af5047373aeb
user:      oster <oster%NetBSD.org@localhost>
date:      Mon Dec 29 05:36:19 2003 +0000

description:
cond_destroyer joins mutex_destroyer in the "nothing useful is done
here" department.

remove _rf_init_threadgroup() and rf_destroy_threadgroup() which were
already #if 0'ed.

rf_cond_destroy() does nothing.  Nuke it, and all callers.

rf_cond_init() doesn't deserve to be a separate function any more.
Fix up the remaining 3 callers, and nuke rf_cond_init().

Another 0.4K goes "poof", but still no functionality lost!

diffstat:

 sys/dev/raidframe/rf_paritylogging.c |  20 +-------
 sys/dev/raidframe/rf_threadstuff.c   |  82 +----------------------------------
 sys/dev/raidframe/rf_threadstuff.h   |   4 +-
 3 files changed, 9 insertions(+), 97 deletions(-)

diffs (218 lines):

diff -r e7e257ddd8db -r af5047373aeb sys/dev/raidframe/rf_paritylogging.c
--- a/sys/dev/raidframe/rf_paritylogging.c      Mon Dec 29 05:22:16 2003 +0000
+++ b/sys/dev/raidframe/rf_paritylogging.c      Mon Dec 29 05:36:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_paritylogging.c,v 1.19 2003/12/29 05:22:16 oster Exp $      */
+/*     $NetBSD: rf_paritylogging.c,v 1.20 2003/12/29 05:36:19 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.19 2003/12/29 05:22:16 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_paritylogging.c,v 1.20 2003/12/29 05:36:19 oster Exp $");
 
 #include "rf_archs.h"
 
@@ -310,11 +310,7 @@
                rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
                return (ENOMEM);
        }
-       rc = rf_cond_init(&raidPtr->regionBufferPool.cond);
-       if (rc) {
-               rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
-               return (ENOMEM);
-       }
+       raidPtr->regionBufferPool.cond = 0;
        raidPtr->regionBufferPool.bufferSize = raidPtr->regionLogCapacity * 
                raidPtr->bytesPerSector;
        printf("regionBufferPool.bufferSize %d\n", 
@@ -334,7 +330,6 @@
                  raidPtr->regionBufferPool.totalBuffers * sizeof(caddr_t), 
                  (caddr_t *));
        if (raidPtr->regionBufferPool.buffers == NULL) {
-               rf_cond_destroy(&raidPtr->regionBufferPool.cond);
                return (ENOMEM);
        }
        for (i = 0; i < raidPtr->regionBufferPool.totalBuffers; i++) {
@@ -345,7 +340,6 @@
                          raidPtr->regionBufferPool.bufferSize * sizeof(char),
                          (caddr_t));
                if (raidPtr->regionBufferPool.buffers[i] == NULL) {
-                       rf_cond_destroy(&raidPtr->regionBufferPool.cond);
                        for (j = 0; j < i; j++) {
                                RF_Free(raidPtr->regionBufferPool.buffers[i], 
                                        raidPtr->regionBufferPool.bufferSize *
@@ -375,11 +369,7 @@
                rf_print_unable_to_init_mutex(__FILE__, __LINE__, rc);
                return (rc);
        }
-       rc = rf_cond_init(&raidPtr->parityBufferPool.cond);
-       if (rc) {
-               rf_print_unable_to_init_cond(__FILE__, __LINE__, rc);
-               return (ENOMEM);
-       }
+       raidPtr->parityBufferPool.cond = 0;
        raidPtr->parityBufferPool.bufferSize = parityBufferCapacity * 
                raidPtr->bytesPerSector;
        printf("parityBufferPool.bufferSize %d\n", 
@@ -400,7 +390,6 @@
                  raidPtr->parityBufferPool.totalBuffers * sizeof(caddr_t), 
                  (caddr_t *));
        if (raidPtr->parityBufferPool.buffers == NULL) {
-               rf_cond_destroy(&raidPtr->parityBufferPool.cond);
                return (ENOMEM);
        }
        for (i = 0; i < raidPtr->parityBufferPool.totalBuffers; i++) {
@@ -411,7 +400,6 @@
                          raidPtr->parityBufferPool.bufferSize * sizeof(char),
                          (caddr_t));
                if (raidPtr->parityBufferPool.buffers == NULL) {
-                       rf_cond_destroy(&raidPtr->parityBufferPool.cond);
                        for (j = 0; j < i; j++) {
                                RF_Free(raidPtr->parityBufferPool.buffers[i], 
                                        raidPtr->regionBufferPool.bufferSize * 
diff -r e7e257ddd8db -r af5047373aeb sys/dev/raidframe/rf_threadstuff.c
--- a/sys/dev/raidframe/rf_threadstuff.c        Mon Dec 29 05:22:16 2003 +0000
+++ b/sys/dev/raidframe/rf_threadstuff.c        Mon Dec 29 05:36:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_threadstuff.c,v 1.16 2003/12/29 05:22:16 oster Exp $        */
+/*     $NetBSD: rf_threadstuff.c,v 1.17 2003/12/29 05:36:19 oster Exp $        */
 /*
  * rf_threadstuff.c
  */
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.16 2003/12/29 05:22:16 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_threadstuff.c,v 1.17 2003/12/29 05:36:19 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -38,24 +38,10 @@
 #include "rf_general.h"
 #include "rf_shutdown.h"
 
-static void cond_destroyer(void *);
-
 /*
  * Shared stuff
  */
 
-static void 
-cond_destroyer(arg)
-       void   *arg;
-{
-       int     rc;
-
-       rc = rf_cond_destroy(arg);
-       if (rc) {
-               RF_ERRORMSG1("RAIDFRAME: Error %d auto-destroying condition\n", rc);
-       }
-}
-
 #if 0
 int 
 _rf_create_managed_lkmgr_mutex(listp, m, file, line)
@@ -87,20 +73,9 @@
        char   *file;
        int     line;
 {
-       int     rc, rc1;
 
-       rc = rf_cond_init(c);
-       if (rc)
-               return (rc);
-       rc = _rf_ShutdownCreate(listp, cond_destroyer, (void *) c, file, line);
-       if (rc) {
-               RF_ERRORMSG1("RAIDFRAME: Error %d adding shutdown entry\n", rc);
-               rc1 = rf_cond_destroy(c);
-               if (rc1) {
-                       RF_ERRORMSG1("RAIDFRAME: Error %d destroying cond\n", rc1);
-               }
-       }
-       return (rc);
+       c = 0;
+       return (0);
 }
 
 int 
@@ -119,40 +94,6 @@
        g->created = g->running = g->shutdown = 0;
        return (0);
 }
-#if 0
-int 
-_rf_destroy_threadgroup(g, file, line)
-       RF_ThreadGroup_t *g;
-       char   *file;
-       int     line;
-{
-       int     rc1, rc2;
-
-       rc2 = rf_cond_destroy(&g->cond);
-       if (rc1)
-               return (rc1);
-       return (rc2);
-}
-
-int 
-_rf_init_threadgroup(g, file, line)
-       RF_ThreadGroup_t *g;
-       char   *file;
-       int     line;
-{
-       int     rc;
-
-       rc = rf_mutex_init(&g->mutex);
-       if (rc)
-               return (rc);
-       rc = rf_cond_init(&g->cond);
-       if (rc) {
-               return (rc);
-       }
-       g->created = g->running = g->shutdown = 0;
-       return (0);
-}
-#endif
 
 /*
  * Kernel
@@ -173,18 +114,3 @@
        return(0);
 }
 #endif
-
-int 
-rf_cond_init(c)
-RF_DECLARE_COND(*c)
-{
-       *c = 0;                 /* no reason */
-       return (0);
-}
-
-int 
-rf_cond_destroy(c)
-RF_DECLARE_COND(*c)
-{
-       return (0);
-}
diff -r e7e257ddd8db -r af5047373aeb sys/dev/raidframe/rf_threadstuff.h
--- a/sys/dev/raidframe/rf_threadstuff.h        Mon Dec 29 05:22:16 2003 +0000
+++ b/sys/dev/raidframe/rf_threadstuff.h        Mon Dec 29 05:36:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_threadstuff.h,v 1.16 2003/12/29 05:22:16 oster Exp $        */
+/*     $NetBSD: rf_threadstuff.h,v 1.17 2003/12/29 05:36:19 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -193,6 +193,4 @@
 _rf_create_managed_cond(RF_ShutdownList_t ** listp, int *,
     char *file, int line);
 
-int     rf_cond_init(int *c);
-int     rf_cond_destroy(int *c);
 #endif                         /* !_RF__RF_THREADSTUFF_H_ */



Home | Main Index | Thread Index | Old Index