Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Introduce RF_DEBUG_MAP, and use it to igno...



details:   https://anonhg.NetBSD.org/src/rev/1751190d87be
branches:  trunk
changeset: 536657:1751190d87be
user:      oster <oster%NetBSD.org@localhost>
date:      Thu Sep 19 23:23:19 2002 +0000

description:
Introduce RF_DEBUG_MAP, and use it to ignore more rarely used code.

diffstat:

 sys/dev/raidframe/rf_archs.h |   6 +++++-
 sys/dev/raidframe/rf_map.c   |  15 ++++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (99 lines):

diff -r 919c67ac3902 -r 1751190d87be sys/dev/raidframe/rf_archs.h
--- a/sys/dev/raidframe/rf_archs.h      Thu Sep 19 23:22:56 2002 +0000
+++ b/sys/dev/raidframe/rf_archs.h      Thu Sep 19 23:23:19 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_archs.h,v 1.19 2002/09/19 22:52:52 oster Exp $      */
+/*     $NetBSD: rf_archs.h,v 1.20 2002/09/19 23:23:19 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -136,6 +136,10 @@
 #define RF_DEBUG_PSS 0
 #endif
 
+#ifndef RF_DEBUG_MAP
+#define RF_DEBUG_MAP 0
+#endif
+
 #include "rf_options.h"
 
 #endif                         /* !_RF__RF_ARCHS_H_ */
diff -r 919c67ac3902 -r 1751190d87be sys/dev/raidframe/rf_map.c
--- a/sys/dev/raidframe/rf_map.c        Thu Sep 19 23:22:56 2002 +0000
+++ b/sys/dev/raidframe/rf_map.c        Thu Sep 19 23:23:19 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_map.c,v 1.14 2002/09/14 17:53:59 oster Exp $        */
+/*     $NetBSD: rf_map.c,v 1.15 2002/09/19 23:23:19 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  **************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.14 2002/09/14 17:53:59 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.15 2002/09/19 23:23:19 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -121,8 +121,10 @@
                    (int) raidAddress);
                return (NULL);
        }
+#if RF_DEBUG_MAP
        if (rf_mapDebug)
                rf_PrintRaidAddressInfo(raidPtr, raidAddress, numBlocks);
+#endif
        for (; raidAddress < endAddress;) {
                /* make the next stripe structure */
                RF_ASSERT(asmList);
@@ -244,8 +246,10 @@
        asm_hdr->numStripes = numStripes;
        asm_hdr->stripeMap = asm_list;
 
+#if RF_DEBUG_MAP
        if (rf_mapDebug)
                rf_PrintAccessStripeMap(asm_hdr);
+#endif
        return (asm_hdr);
 }
 /*****************************************************************************************
@@ -692,6 +696,7 @@
        }
 }
 
+#if RF_MAP_DEBUG
 void 
 rf_PrintRaidAddressInfo(raidPtr, raidAddr, numBlocks)
        RF_Raid_t *raidPtr;
@@ -710,6 +715,7 @@
            (int) (raidAddr % layoutPtr->sectorsPerStripeUnit),
            (int) (raidAddr % layoutPtr->sectorsPerStripeUnit));
 }
+#endif
 /*
    given a parity descriptor and the starting address within a stripe,
    range restrict the parity descriptor to touch only the correct stuff.
@@ -796,18 +802,21 @@
        } else
                if (dstatus == rf_ds_dist_spared) {
                        /* ditto if disk has been spared to dist spare space */
+#if RF_DEBUG_MAP
                        RF_RowCol_t or = pda_p->row, oc = pda_p->col;
                        RF_SectorNum_t oo = pda_p->startSector;
-
+#endif
                        if (pda_p->type == RF_PDA_TYPE_DATA)
                                raidPtr->Layout.map->MapSector(raidPtr, pda_p->raidAddress, &pda_p->row, &pda_p->col, &pda_p->startSector, RF_REMAP);
                        else
                                raidPtr->Layout.map->MapParity(raidPtr, pda_p->raidAddress, &pda_p->row, &pda_p->col, &pda_p->startSector, RF_REMAP);
 
+#if RF_DEBUG_MAP
                        if (rf_mapDebug) {
                                printf("Redirected r %d c %d o %d -> r%d c %d o %d\n", or, oc, (int) oo,
                                    pda_p->row, pda_p->col, (int) pda_p->startSector);
                        }
+#endif
                } else
                        if (RF_DEAD_DISK(dstatus)) {
                                /* if the disk is inaccessible, mark the



Home | Main Index | Thread Index | Old Index