diff options
author | le <le@FreeBSD.org> | 2004-07-31 21:34:21 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2004-07-31 21:34:21 +0000 |
commit | e2ca49b0bcd13f1d69de203a5dcaf82c8ac5ff84 (patch) | |
tree | 4fecad88c5013a737d51e0e9adb5d9f0f0e5cae8 | |
parent | 900350dd1b8d0c711f44a96c690aba2081bc30b5 (diff) | |
download | FreeBSD-src-e2ca49b0bcd13f1d69de203a5dcaf82c8ac5ff84.zip FreeBSD-src-e2ca49b0bcd13f1d69de203a5dcaf82c8ac5ff84.tar.gz |
Propagate size changes upwards.
-rw-r--r-- | sys/geom/vinum/geom_vinum.h | 1 | ||||
-rw-r--r-- | sys/geom/vinum/geom_vinum_plex.c | 4 | ||||
-rw-r--r-- | sys/geom/vinum/geom_vinum_subr.c | 20 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sys/geom/vinum/geom_vinum.h b/sys/geom/vinum/geom_vinum.h index 567c8b6..d69e104 100644 --- a/sys/geom/vinum/geom_vinum.h +++ b/sys/geom/vinum/geom_vinum.h @@ -75,5 +75,6 @@ int gv_sd_to_drive(struct gv_softc *, struct gv_drive *, struct gv_sd *, char *, int); int gv_sd_to_plex(struct gv_plex *, struct gv_sd *, int); void gv_update_plex_config(struct gv_plex *); +void gv_update_vol_size(struct gv_volume *, off_t); #endif /* !_GEOM_VINUM_H_ */ diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c index bcb1327..e44a64e 100644 --- a/sys/geom/vinum/geom_vinum_plex.c +++ b/sys/geom/vinum/geom_vinum_plex.c @@ -410,6 +410,10 @@ gv_plex_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) LIST_FOREACH(pp2, &gp->provider, provider) pp2->mediasize = p->size; + /* Update the size of the volume this plex is attached to. */ + if (p->vol_sc != NULL) + gv_update_vol_size(p->vol_sc, p->size); + return (NULL); /* We need to create a new geom. */ diff --git a/sys/geom/vinum/geom_vinum_subr.c b/sys/geom/vinum/geom_vinum_subr.c index d5e1851..695d764 100644 --- a/sys/geom/vinum/geom_vinum_subr.c +++ b/sys/geom/vinum/geom_vinum_subr.c @@ -336,6 +336,26 @@ gv_sd_to_plex(struct gv_plex *p, struct gv_sd *s, int check) } void +gv_update_vol_size(struct gv_volume *v, off_t size) +{ + struct g_geom *gp; + struct g_provider *pp; + + if (v == NULL) + return; + + gp = v->geom; + if (gp == NULL) + return; + + LIST_FOREACH(pp, &gp->provider, provider) { + pp->mediasize = size; + } + + v->size = size; +} + +void gv_update_plex_config(struct gv_plex *p) { struct gv_sd *s, *s2; |