summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2002-09-19 23:23:19 +0000
committeroster <oster@NetBSD.org>2002-09-19 23:23:19 +0000
commit5faa29ac7d8e4e5dcf90f9b2cf8a17d91840c5c4 (patch)
tree8558b26a6c67a6437fae301b5d0fd537bd28ee92 /sys/dev
parent600684fe1c3406034c0f793767603e465d0485d5 (diff)
Introduce RF_DEBUG_MAP, and use it to ignore more rarely used code.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/raidframe/rf_archs.h6
-rw-r--r--sys/dev/raidframe/rf_map.c15
2 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/raidframe/rf_archs.h b/sys/dev/raidframe/rf_archs.h
index 28457aff8e0..a9cf9cba2c8 100644
--- a/sys/dev/raidframe/rf_archs.h
+++ b/sys/dev/raidframe/rf_archs.h
@@ -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 --git a/sys/dev/raidframe/rf_map.c b/sys/dev/raidframe/rf_map.c
index 2b6c9840419..1bc24f3c18b 100644
--- a/sys/dev/raidframe/rf_map.c
+++ b/sys/dev/raidframe/rf_map.c
@@ -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 @@ rf_MapAccess(raidPtr, raidAddress, numBlocks, buffer, remap)
(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 @@ rf_MapAccess(raidPtr, raidAddress, numBlocks, buffer, remap)
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 @@ rf_PrintFullAccessStripeMap(asm_h, prbuf)
}
}
+#if RF_MAP_DEBUG
void
rf_PrintRaidAddressInfo(raidPtr, raidAddr, numBlocks)
RF_Raid_t *raidPtr;
@@ -710,6 +715,7 @@ rf_PrintRaidAddressInfo(raidPtr, raidAddr, numBlocks)
(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 @@ rf_ASMCheckStatus(
} 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