summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2000-12-20 05:13:26 +0000
committergrog <grog@FreeBSD.org>2000-12-20 05:13:26 +0000
commitb2197cbfe9b7d0729e04f011555172f48dce7ec9 (patch)
tree620c0e8718206ab28cb602bc72bcb8258b2852e1 /sys/dev/vinum
parentaadcf755e89811d47fe9c462d3f55152ce70f2d6 (diff)
downloadFreeBSD-src-b2197cbfe9b7d0729e04f011555172f48dce7ec9.zip
FreeBSD-src-b2197cbfe9b7d0729e04f011555172f48dce7ec9.tar.gz
give_plex_to_volume: Recalculate volume size after attaching.
Cosmetics.
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinumconfig.c8
-rw-r--r--sys/dev/vinum/vinuminterrupt.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index 06850c8..7dd36db 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -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;
diff --git a/sys/dev/vinum/vinuminterrupt.c b/sys/dev/vinum/vinuminterrupt.c
index 68eec58..d5ce417 100644
--- a/sys/dev/vinum/vinuminterrupt.c
+++ b/sys/dev/vinum/vinuminterrupt.c
@@ -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);
}
OpenPOWER on IntegriCloud