rf_ReleaseBufferWaiter(s) were not being used! Thanks Krister!

This commit is contained in:
oster 2002-09-21 01:21:19 +00:00
parent 580f8b6e1e
commit 0efe63f46b
2 changed files with 3 additions and 58 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconbuffer.c,v 1.8 2002/09/11 02:22:49 oster Exp $ */
/* $NetBSD: rf_reconbuffer.c,v 1.9 2002/09/21 01:21: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_reconbuffer.c,v 1.8 2002/09/11 02:22:49 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconbuffer.c,v 1.9 2002/09/21 01:21:19 oster Exp $");
#include "rf_raid.h"
#include "rf_reconbuffer.h"
@ -424,54 +424,3 @@ rf_ReleaseFloatingReconBuffer(raidPtr, row, rbuf)
rcPtr->floatingRbufs = rbuf;
}
}
/* release any disk that is waiting on a buffer for the indicated RU.
* assumes the rb_mutex is LOCKED at entry
*/
void
rf_ReleaseBufferWaiters(raidPtr, pssPtr)
RF_Raid_t *raidPtr;
RF_ReconParityStripeStatus_t *pssPtr;
{
RF_CallbackDesc_t *cb1, *cb = pssPtr->bufWaitList;
Dprintf2("RECON: releasing buf waiters for psid %ld ru %d\n",
(long) pssPtr->parityStripeID, pssPtr->which_ru);
pssPtr->flags &= ~RF_PSS_BUFFERWAIT;
while (cb) {
cb1 = cb->next;
cb->next = NULL;
rf_CauseReconEvent(raidPtr, cb->row, cb->col, (void *) 0, RF_REVENT_BUFCLEAR); /* arg==0 => we haven't
* committed a buffer */
rf_FreeCallbackDesc(cb);
cb = cb1;
}
pssPtr->bufWaitList = NULL;
}
/* when reconstruction is forced on an RU, there may be some disks waiting to
* acquire a buffer for that RU. Since we allocate a new buffer as part of
* the forced-reconstruction process, we no longer have to wait for any
* buffers, so we wakeup any waiter that we find in the bufferWaitList
*
* assumes the rb_mutex is LOCKED at entry
*/
void
rf_ReleaseBufferWaiter(rcPtr, rbuf)
RF_ReconCtrl_t *rcPtr;
RF_ReconBuffer_t *rbuf;
{
RF_CallbackDesc_t *cb, *cbt;
for (cbt = NULL, cb = rcPtr->bufferWaitList; cb; cbt = cb, cb = cb->next) {
if ((cb->callbackArg.v == rbuf->parityStripeID) && (cb->callbackArg2.v == rbuf->which_ru)) {
Dprintf2("RECON: Dropping row %d col %d from buffer wait list\n", cb->row, cb->col);
if (cbt)
cbt->next = cb->next;
else
rcPtr->bufferWaitList = cb->next;
rf_CauseReconEvent((RF_Raid_t *) rbuf->raidPtr, cb->row, cb->col, (void *) 0, RF_REVENT_BUFREADY); /* arg==0 => no
* committed buffer */
rf_FreeCallbackDesc(cb);
return;
}
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconbuffer.h,v 1.4 2001/10/04 15:58:55 oster Exp $ */
/* $NetBSD: rf_reconbuffer.h,v 1.5 2002/09/21 01:21:19 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -55,9 +55,5 @@ rf_CheckForFullRbuf(RF_Raid_t * raidPtr, RF_ReconCtrl_t * reconCtrl,
void
rf_ReleaseFloatingReconBuffer(RF_Raid_t * raidPtr, RF_RowCol_t row,
RF_ReconBuffer_t * rbuf);
void
rf_ReleaseBufferWaiters(RF_Raid_t * raidPtr,
RF_ReconParityStripeStatus_t * pssPtr);
void rf_ReleaseBufferWaiter(RF_ReconCtrl_t * rcPtr, RF_ReconBuffer_t * rbuf);
#endif /* !_RF__RF_RECONBUFFER_H_ */