Propagate size changes upwards.

This commit is contained in:
Lukas Ertl 2004-07-31 21:34:21 +00:00
parent 6c97c0e45e
commit 4b017d0d93
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132940
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)
{