Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe access_tracebuf is declared, allocated, an...



details:   https://anonhg.NetBSD.org/src/rev/40a4eaa5ae76
branches:  trunk
changeset: 556922:40a4eaa5ae76
user:      oster <oster%NetBSD.org@localhost>
date:      Tue Dec 30 17:29:41 2003 +0000

description:
access_tracebuf is declared, allocated, and freed.  No freeloading
datastructures allowed!  Punt.

accessTraceBufCount, rf_accessTraceBufSize, and
rf_stopCollectingTraces are similarly declared, initialized, and then
never changed.  Punt.

rf_ShutdownAccessTrace() now does nothing.  Remove it, and the
callback setup stuff from rf_ConfigureAccessTrace().

diffstat:

 sys/dev/raidframe/rf_acctrace.c |  37 +++++--------------------------------
 1 files changed, 5 insertions(+), 32 deletions(-)

diffs (75 lines):

diff -r 3c27c4632c48 -r 40a4eaa5ae76 sys/dev/raidframe/rf_acctrace.c
--- a/sys/dev/raidframe/rf_acctrace.c   Tue Dec 30 17:18:11 2003 +0000
+++ b/sys/dev/raidframe/rf_acctrace.c   Tue Dec 30 17:29:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_acctrace.c,v 1.12 2003/12/29 05:01:14 oster Exp $   */
+/*     $NetBSD: rf_acctrace.c,v 1.13 2003/12/30 17:29:41 oster 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.12 2003/12/29 05:01:14 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.13 2003/12/30 17:29:41 oster Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -50,45 +50,18 @@
 #include "rf_shutdown.h"
 
 static long numTracesSoFar;
-static int accessTraceBufCount = 0;
-static RF_AccTraceEntry_t *access_tracebuf;
 
-int     rf_stopCollectingTraces;
 RF_DECLARE_MUTEX(rf_tracing_mutex)
 
-static void rf_ShutdownAccessTrace(void *);
-
-static void rf_ShutdownAccessTrace(ignored)
-       void   *ignored;
-{
-       if (rf_accessTraceBufSize) {
-               if (accessTraceBufCount)
-                               accessTraceBufCount = 0;
-               RF_Free(access_tracebuf, rf_accessTraceBufSize * sizeof(RF_AccTraceEntry_t));
-       }
-}
-
 int 
 rf_ConfigureAccessTrace(listp)
        RF_ShutdownList_t **listp;
 {
-       int     rc;
 
-       accessTraceBufCount = rf_stopCollectingTraces = 0;
-       if (rf_accessTraceBufSize) {
-               RF_Malloc(access_tracebuf, rf_accessTraceBufSize * sizeof(RF_AccTraceEntry_t), (RF_AccTraceEntry_t *));
-               accessTraceBufCount = 0;
-       }
        numTracesSoFar = 0;
        rf_mutex_init(&rf_tracing_mutex);
-       rc = rf_ShutdownCreate(listp, rf_ShutdownAccessTrace, NULL);
-       if (rc) {
-               rf_print_unable_to_add_shutdown(__FILE__, __LINE__, rc);
-               if (rf_accessTraceBufSize) {
-                       RF_Free(access_tracebuf, rf_accessTraceBufSize * sizeof(RF_AccTraceEntry_t));
-               }
-       }
-       return (rc);
+
+       return (0);
 }
 /* install a trace record.  cause a flush to disk or to the trace collector daemon
  * if the trace buffer is at least 1/2 full.
@@ -100,7 +73,7 @@
 {
        RF_AccTotals_t *acc = &raid->acc_totals;
 
-       if (rf_stopCollectingTraces || ((rf_maxNumTraces >= 0) && (numTracesSoFar >= rf_maxNumTraces)))
+       if (((rf_maxNumTraces >= 0) && (numTracesSoFar >= rf_maxNumTraces)))
                return;
 
        /* update AccTotals for this device */



Home | Main Index | Thread Index | Old Index