Lines Matching defs:rbuf
98 * rbuf - the recon buffer to submit
103 rf_SubmitReconBuffer(RF_ReconBuffer_t *rbuf, int keep_it, int use_committed)
108 lp = rbuf->raidPtr->Layout.map;
109 rc = lp->SubmitReconBuffer(rbuf, keep_it, use_committed);
114 * rbuf - the recon buffer to submit
119 rf_SubmitReconBufferBasic(RF_ReconBuffer_t *rbuf, int keep_it,
122 RF_Raid_t *raidPtr = rbuf->raidPtr;
126 RF_ReconBuffer_t *targetRbuf, *t = NULL; /* temporary rbuf
135 RF_ASSERT(rbuf);
136 RF_ASSERT(rbuf->col != reconCtrlPtr->fcol);
139 rbuf->col, (long) rbuf->parityStripeID, rbuf->which_ru, (long) rbuf->failedDiskSectorOffset);
141 RF_LOCK_PSS_MUTEX(raidPtr, rbuf->parityStripeID);
150 pssPtr = rf_LookupRUStatus(raidPtr, reconCtrlPtr->pssTable, rbuf->parityStripeID, rbuf->which_ru, RF_PSS_NONE, NULL);
152 * an rbuf for it */
155 * so, there's no need to acquire a floating rbuf. Before we can do
160 * floating rbuf. */
162 targetRbuf = (RF_ReconBuffer_t *) pssPtr->rbuf;
165 pssPtr->rbufsForXor[pssPtr->xorBufCount++] = rbuf; /* install this buffer */
166 Dprintf2("RECON: col %d invoking a %d-way XOR\n", rbuf->col, pssPtr->xorBufCount);
174 raidPtr->recon_tracerecs[rbuf->col].xor_us = RF_ETIMER_VAL_US(timer);
175 RF_ETIMER_STOP(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
176 RF_ETIMER_EVAL(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
177 raidPtr->recon_tracerecs[rbuf->col].specific.recon.recon_return_to_submit_us +=
178 RF_ETIMER_VAL_US(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
179 RF_ETIMER_START(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
181 rf_LogTraceRec(raidPtr, &raidPtr->recon_tracerecs[rbuf->col]);
195 RF_UNLOCK_PSS_MUTEX(raidPtr, rbuf->parityStripeID);
200 rf_FreeReconBuffer(rbuf);
205 /* set the value of "t", which we'll use as the rbuf from here on */
207 t = rbuf;
227 Dprintf1("RECON: col %d failed to acquire floating rbuf\n", rbuf->col);
238 cb->col = rbuf->col;
239 cb->v = rbuf->parityStripeID;
251 Dprintf1("RECON: col %d acquired rbuf\n", rbuf->col);
253 RF_ETIMER_STOP(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
254 RF_ETIMER_EVAL(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
255 raidPtr->recon_tracerecs[rbuf->col].specific.recon.recon_return_to_submit_us +=
256 RF_ETIMER_VAL_US(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
257 RF_ETIMER_START(raidPtr->recon_tracerecs[rbuf->col].recon_timer);
259 rf_LogTraceRec(raidPtr, &raidPtr->recon_tracerecs[rbuf->col]);
263 if (t != rbuf) {
265 t->parityStripeID = rbuf->parityStripeID;
266 t->which_ru = rbuf->which_ru;
267 t->failedDiskSectorOffset = rbuf->failedDiskSectorOffset;
268 t->spCol = rbuf->spCol;
269 t->spOffset = rbuf->spOffset;
272 t->buffer = rbuf->buffer;
273 rbuf->buffer = ta; /* swap buffers */
278 if (!pssPtr->rbuf) {
279 pssPtr->rbuf = t;
288 RF_UNLOCK_PSS_MUTEX(raidPtr, rbuf->parityStripeID);
302 RF_ReconBuffer_t *targetRbuf = (RF_ReconBuffer_t *) pssPtr->rbuf;
304 RF_ASSERT(pssPtr->rbuf != NULL);
369 RF_ReconBuffer_t *p, *pt, *rbuf = (RF_ReconBuffer_t *) pssPtr->rbuf;
371 if (rbuf->count == numDataCol) {
373 Dprintf2("RECON: rbuf for psid %ld ru %d has filled\n",
374 (long) rbuf->parityStripeID, rbuf->which_ru);
375 if (!reconCtrl->fullBufferList || (rbuf->failedDiskSectorOffset < reconCtrl->fullBufferList->failedDiskSectorOffset)) {
376 Dprintf2("RECON: rbuf for psid %ld ru %d is head of list\n",
377 (long) rbuf->parityStripeID, rbuf->which_ru);
378 rbuf->next = reconCtrl->fullBufferList;
379 reconCtrl->fullBufferList = rbuf;
381 for (pt = reconCtrl->fullBufferList, p = pt->next; p && p->failedDiskSectorOffset < rbuf->failedDiskSectorOffset; pt = p, p = p->next);
382 rbuf->next = p;
383 pt->next = rbuf;
384 Dprintf2("RECON: rbuf for psid %ld ru %d is in list\n",
385 (long) rbuf->parityStripeID, rbuf->which_ru);
387 rbuf->pssPtr = pssPtr;
388 pssPtr->rbuf = NULL;
389 rf_CauseReconEvent(raidPtr, rbuf->col, NULL, RF_REVENT_BUFREADY);
399 rf_ReleaseFloatingReconBuffer(RF_Raid_t *raidPtr, RF_ReconBuffer_t *rbuf)
404 Dprintf2("RECON: releasing rbuf for psid %ld ru %d\n",
405 (long) rbuf->parityStripeID, rbuf->which_ru);
410 rbuf->next = rcPtr->committedRbufs;
411 rcPtr->committedRbufs = rbuf;
419 rbuf->next = rcPtr->floatingRbufs;
420 rcPtr->floatingRbufs = rbuf;