diff options
| author | oster <oster@NetBSD.org> | 2004-01-04 21:06:04 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2004-01-04 21:06:04 +0000 |
| commit | 290ef1fca7cd7d317e94dca89d10eaa574c5a79c (patch) | |
| tree | bba951f12e74838c1ffca21ddd3da31c4b48e9b5 /sys/dev/raidframe/rf_reconstruct.c | |
| parent | a00e4cf6db902f54d13e92d4cc4453dc31508f77 (diff) | |
raidPtr->reconControl->percentCompleted only gets used in one
debugging printf, and in rf_netbsdkintf.c. We can do the calculations
inside of RF_DEBUG_RECON for the one debugging printf, and only
perform the percentCompleted calculation "on demand" in the
rf_netbsdkintf.c case. Shaves a few more bytes off an i386 GENERIC
kernel, and ever-so-slightly decreases the amount of work performed
during a reconstruct.
Diffstat (limited to 'sys/dev/raidframe/rf_reconstruct.c')
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index 07b3d317982..789c3de0d01 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.64 2003/12/31 04:13:52 oster Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.65 2004/01/04 21:06:04 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.64 2003/12/31 04:13:52 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.65 2004/01/04 21:06:04 oster Exp $"); #include <sys/time.h> #include <sys/buf.h> @@ -653,10 +653,9 @@ rf_ContinueReconstructFailedDisk(RF_RaidReconDesc_t *reconDesc) raidPtr->reconControl->numRUsComplete = mapPtr->totalRUs - rf_UnitsLeftToReconstruct(mapPtr); - +#if RF_DEBUG_RECON raidPtr->reconControl->percentComplete = (raidPtr->reconControl->numRUsComplete * 100 / raidPtr->reconControl->numRUsTotal); -#if RF_DEBUG_RECON if (rf_prReconSched) { rf_PrintReconSchedule(raidPtr->reconControl->reconMap, &(raidPtr->reconControl->starttime)); } @@ -682,8 +681,8 @@ rf_ContinueReconstructFailedDisk(RF_RaidReconDesc_t *reconDesc) RF_ASSERT(event); (void) ProcessReconEvent(raidPtr, event); /* ignore return code */ - raidPtr->reconControl->percentComplete = 100 - (rf_UnitsLeftToReconstruct(mapPtr) * 100 / mapPtr->totalRUs); #if RF_DEBUG_RECON + raidPtr->reconControl->percentComplete = 100 - (rf_UnitsLeftToReconstruct(mapPtr) * 100 / mapPtr->totalRUs); if (rf_prReconSched) { rf_PrintReconSchedule(raidPtr->reconControl->reconMap, &(raidPtr->reconControl->starttime)); } |
