give_plex_to_volume: Recalculate volume size after attaching.

Cosmetics.
This commit is contained in:
Greg Lehey 2000-12-20 05:13:26 +00:00
parent ca4f131c60
commit e872ce018e
2 changed files with 14 additions and 5 deletions

View File

@ -187,6 +187,7 @@ int
give_plex_to_volume(int volno, int plexno)
{
struct volume *vol;
int i;
/*
* It's not an error for the plex to already
@ -209,6 +210,9 @@ give_plex_to_volume(int volno, int plexno)
vol->plexes++; /* add another plex */
PLEX[plexno].volno = volno; /* note the number of our volume */
/* Find out how big our volume is */
for (i = 0; i < vol->plexes; i++)
vol->size = max(vol->size, PLEX[vol->plex[i]].length);
return vol->plexes - 1; /* and return its index */
}
@ -908,7 +912,7 @@ config_drive(int update)
if (drive->state != drive_referenced) { /* we already know this drive */
/*
* XXX Check which definition is more up-to-date. Give
* preference for the definition on its own drive
* preference for the definition on its own drive.
*/
return; /* XXX */
}
@ -970,8 +974,6 @@ config_drive(int update)
break;
case DL_DELETED_LABEL: /* it was a drive, but we deleted it */
break;
case DL_NOT_OURS: /* nothing to do with the rest */
case DL_OURS:
break;

View File

@ -39,7 +39,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
* $Id: vinuminterrupt.c,v 1.11 2000/05/10 22:32:51 grog Exp grog $
* $Id: vinuminterrupt.c,v 1.9 2000/02/16 01:59:02 grog Exp grog $
* $FreeBSD$
*/
@ -209,10 +209,15 @@ freerq(struct request *rq)
for (rqg = rq->rqg; rqg != NULL; rqg = nrqg) { /* through the whole request chain */
if (rqg->lock) /* got a lock? */
unlockrange(rqg->plexno, rqg->lock); /* yes, free it */
for (rqno = 0; rqno < rqg->count; rqno++)
for (rqno = 0; rqno < rqg->count; rqno++) {
if ((rqg->rqe[rqno].flags & XFR_MALLOCED) /* data buffer was malloced, */
&&rqg->rqe[rqno].b.b_data) /* and the allocation succeeded */
Free(rqg->rqe[rqno].b.b_data); /* free it */
if (rqg->rqe[rqno].flags & XFR_BUFLOCKED) { /* locked this buffer, */
BUF_UNLOCK(&rqg->rqe[rqno].b); /* unlock it again */
BUF_LOCKFREE(&rqg->rqe[rqno].b);
}
}
nrqg = rqg->next; /* note the next one */
Free(rqg); /* and free this one */
}
@ -248,6 +253,8 @@ sdio_done(struct buf *bp)
SD[sbp->sdno].bytes_written += sbp->b.b_bcount;
}
bufdone(sbp->bp); /* complete the caller's I/O */
BUF_UNLOCK(&sbp->b);
BUF_LOCKFREE(&sbp->b);
Free(sbp);
}