Propagate size changes upwards.

This commit is contained in:
le 2004-07-31 21:34:21 +00:00
parent 900350dd1b
commit e2ca49b0bc
3 changed files with 25 additions and 0 deletions

View File

@ -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_ */

View File

@ -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. */

View File

@ -335,6 +335,26 @@ gv_sd_to_plex(struct gv_plex *p, struct gv_sd *s, int check)
return (0);
}
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)
{