-/* $OpenBSD: ccd.c,v 1.12 1996/05/10 12:32:11 deraadt Exp $ */
+/* $OpenBSD: ccd.c,v 1.13 1996/12/19 18:26:58 deraadt Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
register struct ccdcinfo *ci, *ci2 = NULL;
register struct ccdbuf *cbp;
register daddr_t cbn, cboff;
+ int ccdisk;
#ifdef DEBUG
if (ccddebug & CCDB_IO)
register daddr_t sblk;
sblk = 0;
- for (ci = cs->sc_cinfo; cbn >= sblk + ci->ci_size; ci++)
+ for (ccdisk = 0, ci = &cs->sc_cinfo[ccdisk];
+ cbn >= sblk + ci->ci_size;
+ ccdisk++, ci = &cs->sc_cinfo[ccdisk])
sblk += ci->ci_size;
cbn -= sblk;
}
*/
else {
register struct ccdiinfo *ii;
- int ccdisk, off;
+ int off;
cboff = cbn % cs->sc_ileave;
cbn /= cs->sc_ileave;
* context for ccdiodone
*/
cbp->cb_obp = bp;
- cbp->cb_unit = cs - ccd_softc;
- cbp->cb_comp = ci - cs->sc_cinfo;
+ cbp->cb_unit = cs->sc_unit;
+ cbp->cb_comp = ccdisk;
/* First buffer is dealt with. */
cbpp[0] = cbp;