Minor comment and 80-column fixes. No functional changes.

This commit is contained in:
oster 2002-10-07 04:05:55 +00:00
parent c6b0ed62ec
commit 16f8b30fa2
1 changed files with 20 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconutil.c,v 1.10 2002/09/17 03:21:41 oster Exp $ */
/* $NetBSD: rf_reconutil.c,v 1.11 2002/10/07 04:05:55 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -31,7 +31,7 @@
********************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.10 2002/09/17 03:21:41 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconutil.c,v 1.11 2002/10/07 04:05:55 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -71,7 +71,10 @@ rf_MakeReconControl(reconDesc, frow, fcol, srow, scol)
/* make and zero the global reconstruction structure and the per-disk
* structure */
RF_Calloc(reconCtrlPtr, 1, sizeof(RF_ReconCtrl_t), (RF_ReconCtrl_t *));
RF_Calloc(reconCtrlPtr->perDiskInfo, raidPtr->numCol, sizeof(RF_PerDiskReconCtrl_t), (RF_PerDiskReconCtrl_t *)); /* this zeros it */
/* note: this zeros the perDiskInfo */
RF_Calloc(reconCtrlPtr->perDiskInfo, raidPtr->numCol,
sizeof(RF_PerDiskReconCtrl_t), (RF_PerDiskReconCtrl_t *));
reconCtrlPtr->reconDesc = reconDesc;
reconCtrlPtr->fcol = fcol;
reconCtrlPtr->spareRow = srow;
@ -84,9 +87,8 @@ rf_MakeReconControl(reconDesc, frow, fcol, srow, scol)
reconCtrlPtr->perDiskInfo[i].reconCtrl = reconCtrlPtr;
reconCtrlPtr->perDiskInfo[i].row = frow;
reconCtrlPtr->perDiskInfo[i].col = i;
reconCtrlPtr->perDiskInfo[i].curPSID = -1; /* make it appear as if
* we just finished an
* RU */
/* make it appear as if we just finished an RU */
reconCtrlPtr->perDiskInfo[i].curPSID = -1;
reconCtrlPtr->perDiskInfo[i].ru_count = RUsPerPU - 1;
}
@ -145,7 +147,8 @@ rf_MakeReconControl(reconDesc, frow, fcol, srow, scol)
reconCtrlPtr->floatingRbufs = NULL;
reconCtrlPtr->committedRbufs = NULL;
for (i = 0; i < raidPtr->numFloatingReconBufs; i++) {
rbuf = rf_MakeReconBuffer(raidPtr, frow, fcol, RF_RBUF_TYPE_FLOATING);
rbuf = rf_MakeReconBuffer(raidPtr, frow, fcol,
RF_RBUF_TYPE_FLOATING);
rbuf->next = reconCtrlPtr->floatingRbufs;
reconCtrlPtr->floatingRbufs = rbuf;
}
@ -183,7 +186,8 @@ rf_FreeReconControl(raidPtr, row)
rf_cond_destroy(&reconCtrlPtr->eq_cond);
rf_FreeReconMap(reconCtrlPtr->reconMap);
rf_FreeParityStripeStatusTable(raidPtr, reconCtrlPtr->pssTable);
RF_Free(reconCtrlPtr->perDiskInfo, raidPtr->numCol * sizeof(RF_PerDiskReconCtrl_t));
RF_Free(reconCtrlPtr->perDiskInfo,
raidPtr->numCol * sizeof(RF_PerDiskReconCtrl_t));
RF_Free(reconCtrlPtr, sizeof(*reconCtrlPtr));
}
@ -312,19 +316,23 @@ rf_CheckFloatingRbufCount(raidPtr, dolock)
RF_UNLOCK_MUTEX(pssTable[i].mutex);
}
for (rbuf = raidPtr->reconControl[frow]->floatingRbufs; rbuf; rbuf = rbuf->next) {
for (rbuf = raidPtr->reconControl[frow]->floatingRbufs; rbuf;
rbuf = rbuf->next) {
if (rbuf->type == RF_RBUF_TYPE_FLOATING)
sum++;
}
for (rbuf = raidPtr->reconControl[frow]->committedRbufs; rbuf; rbuf = rbuf->next) {
for (rbuf = raidPtr->reconControl[frow]->committedRbufs; rbuf;
rbuf = rbuf->next) {
if (rbuf->type == RF_RBUF_TYPE_FLOATING)
sum++;
}
for (rbuf = raidPtr->reconControl[frow]->fullBufferList; rbuf; rbuf = rbuf->next) {
for (rbuf = raidPtr->reconControl[frow]->fullBufferList; rbuf;
rbuf = rbuf->next) {
if (rbuf->type == RF_RBUF_TYPE_FLOATING)
sum++;
}
for (rbuf = raidPtr->reconControl[frow]->priorityList; rbuf; rbuf = rbuf->next) {
for (rbuf = raidPtr->reconControl[frow]->priorityList; rbuf;
rbuf = rbuf->next) {
if (rbuf->type == RF_RBUF_TYPE_FLOATING)
sum++;
}