SD
void SD(int);
/* 000-017 */ MA, BL, MP, YA, SD, EL, MN, IF, DPC, S, S, DT, RD, S, DNW,LIB,
if (SD != NULL) {
Free(SD);
SD = (struct sd *) Malloc(sizeof(struct sd) * INITIAL_SUBDISKS);
CHECKALLOC(SD, "vinum: no memory\n");
bzero(SD, sizeof(struct sd) * INITIAL_SUBDISKS);
||(SD[index].state < sd_init)) /* or SD is not real */
sd = &SD[index];
SD[index].flags &= ~VF_OPEN; /* reset our flags */
if ((SD[sdno].state > sd_referenced)
&& (SD[sdno].driveno == driveno)) {
if (SD[sdno].state > sd_stale)
SD[sdno].state = sd_stale;
sd = &SD[sdno]; /* and get a pointer */
if (SD[namedsdno].state == sd_referenced) { /* we've been told about this one */
*sd = SD[namedsdno]; /* copy from the referenced one */
SD[namedsdno].state = sd_unallocated; /* and deallocate the referenced one */
made_sd(&SD[namedsdno]);
SD[sdno].plexoffset = sizespec(token[++parameter]); /* get the offset */
if ((SD[sdno].state != sd_unallocated) /* subdisk is allocated */
&&(SD[sdno].driveno == driveno)) /* and it belongs to this drive */
struct sd *sd = &SD[sdno];
mysdno < plex->subdisks && &SD[plex->sdnos[mysdno]] != sd;
SD[mysdno].name,
SD[plex->sdnos[sdno]].plexno = -1; /* no plex any more */
SD[sdno].flags &= ~VF_NEWBORN;
sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
sd = &SD[plex->sdnos[sdno]];
&& (sd->sectors != SD[plex->sdnos[sdno - 1]].sectors)) {
sd = &SD[sdno]; /* and the subdisk */
struct sd *lastsd = &SD[plex->sdnos[plex->subdisks - 1]]; /* last subdisk */
if (sd->plexoffset < SD[plex->sdnos[i]].plexoffset) { /* it fits before this one */
sd = &SD[sdno]; /* point to sd */
if (SD[sdno].state == sd_unallocated) /* bingo */
EXPAND(SD, struct sd, vinum_conf.subdisks_allocated, INITIAL_SUBDISKS);
sd = &SD[sdno]; /* point to it */
if (strcmp(SD[sdno].name, name) == 0) /* found it */
sd = &SD[sdno];
sd = &SD[sdno];
SD[rqe->sdno].reads++;
SD[rqe->sdno].bytes_read += bp->b_bcount;
SD[rqe->sdno].writes++;
SD[rqe->sdno].bytes_written += bp->b_bcount;
SD[sbp->sdno].reads++;
SD[sbp->sdno].bytes_read += sbp->b.b_bcount;
SD[sbp->sdno].writes++;
SD[sbp->sdno].bytes_written += sbp->b.b_bcount;
(uintmax_t)(rqe->b.b_bio1.bio_offset - ((off_t)SD[rqe->sdno].driveoffset << DEV_BSHIFT)),
(uintmax_t)(rqe->b.b_bio1.bio_offset - ((off_t)SD[rqe->sdno].driveoffset << DEV_BSHIFT)),
sd = &SD[rqe->sdno];
if ((SD[sdno].driveno == i) /* it's pointing to this one, */
&&(SD[sdno].state != sd_unallocated)) { /* and it's a real subdisk */
SD[sdno].driveno = drive->driveno; /* point to the one we found */
sd = &SD[i];
bcopy(&SD[index], data, sizeof(struct sd));
bcopy(&SD[PLEX[index].sdnos[sdno]], data, sizeof(struct sd));
&& (SD[sdno].state > sd_referenced))
return &SD[sdno];
struct sd *sd = &SD[msg->index];
sd = &SD[plex->sdnos[sdno]];
struct sd *sd = &SD[plex->sdnos[sdno]];
if (SD[plex->sdnos[m.psdno]].state < sd_reborn) /* is our parity subdisk down? */
if (SD[plex->sdnos[mysdno]].state < sd_reborn) { /* got a bad subdisk, */
sd = &SD[plex->sdnos[mysdno]];
struct sd *sd = &SD[plex->sdnos[sdno]];
struct sd *psd = &SD[plex->sdnos[m.psdno]];
sd = &SD[plex->sdnos[m.psdno]]; /* the subdisk in question */
sd = &SD[plex->sdnos[mysdno]]; /* the subdisk in question */
sd = &SD[plex->sdnos[mysdno]]; /* the subdisk in question */
sd = &SD[rq->sdno];
(uintmax_t)(rqe->b.b_bio1.bio_offset - ((off_t)SD[rqe->sdno].driveoffset << DEV_BSHIFT)),
sd = &SD[plex->sdnos[sdno]];
sd = &SD[plex->sdnos[sdno]]; /* the subdisk in question */
sd = &SD[rqe->sdno]; /* point to subdisk */
sd = &SD[Sdno(dev)]; /* point to the subdisk */
(uintmax_t)(sbp->b.b_bio1.bio_offset - ((off_t)SD[sbp->sdno].driveoffset << DEV_BSHIFT)),
dev = SD[sdno].sd_dev;
if (plex->checkblock >= SD[plex->sdnos[0]].sectors) { /* finished */
bpp[sdno]->b_bio1.bio_driver_info = SD[plex->sdnos[psd]].sd_dev; /* write back to the parity SD */
bpp[sdno]->b_bio1.bio_driver_info = SD[plex->sdnos[sdno]].sd_dev; /* device number */
sd = &SD[sdno];
bp->b_bio1.bio_driver_info = SD[sdno].sd_dev;
bp->b_bio1.bio_driver_info = SD[sdno].sd_dev;
sd = &SD[sdno];
sd = &SD[plex->sdnos[sdno]];
sd = &SD[msg->index];
struct sd *sd = &SD[sdno];
SD[msg->index].state = msg->state;
sd = &SD[sdno];
SD[plex->sdnos[sdno]].state = sd_up;
SD[plex->sdnos[sdno]].name);
struct sd *sd = &SD[plex->sdnos[sdno]]; /* point to the subdisk */
if ((SD[sdno].state >= sd_referenced)
&& (SD[sdno].driveno == driveno)) /* belongs to this drive */
struct sd *sd = &SD[plex->sdnos[sdno]];
if (DRIVE[SD[objindex].driveno].state != drive_up) {
SD[objindex].revive_blocksize = data->blocksize;
if ((SD[objindex].state == sd_reviving) /* reviving, */
||(SD[objindex].state == sd_stale)) { /* or stale, will revive */
SD[objindex].state = sd_reviving; /* make sure we're reviving */
} else if (SD[objindex].state == sd_initializing) { /* initializing, */
SD[objindex].init_blocksize = data->blocksize;
if (SD[objindex].state != sd_up) /* set status on whether we really did it */
sd = &SD[msg->index];