diff options
author | le <le@FreeBSD.org> | 2005-01-21 18:27:23 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2005-01-21 18:27:23 +0000 |
commit | 082eb6999014ff2e7e0043cb5500e9a3f00f79c3 (patch) | |
tree | 5b077e0fa8271d499c503e5803a04a952e1cca68 /sys | |
parent | f7ba150b68306114aa6c3f04dd97e0457a428c72 (diff) | |
download | FreeBSD-src-082eb6999014ff2e7e0043cb5500e9a3f00f79c3.zip FreeBSD-src-082eb6999014ff2e7e0043cb5500e9a3f00f79c3.tar.gz |
Only report state changes of subdisks and plexes when there's
really a state change.
Reword the info a bit.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/vinum/geom_vinum_state.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/geom/vinum/geom_vinum_state.c b/sys/geom/vinum/geom_vinum_state.c index 6913a4b..81e305a 100644 --- a/sys/geom/vinum/geom_vinum_state.c +++ b/sys/geom/vinum/geom_vinum_state.c @@ -259,10 +259,13 @@ void gv_update_sd_state(struct gv_sd *s) { struct gv_drive *d; + int oldstate; KASSERT(s != NULL, ("gv_update_sd_state: NULL s")); d = s->drive_sc; KASSERT(d != NULL, ("gv_update_sd_state: NULL d")); + + oldstate = s->state; /* If our drive isn't up we cannot be up either. */ if (d->state != GV_DRIVE_UP) @@ -276,7 +279,10 @@ gv_update_sd_state(struct gv_sd *s) else s->state = GV_SD_UP; - printf("GEOM_VINUM: subdisk %s is %s\n", s->name, gv_sdstate(s->state)); + if (s->state != oldstate) + printf("GEOM_VINUM: subdisk %s state change: %s -> %s\n", + s->name, gv_sdstate(oldstate), gv_sdstate(s->state)); + /* Update the plex, if we have one. */ if (s->plex_sc != NULL) gv_update_plex_state(s->plex_sc); @@ -287,9 +293,12 @@ void gv_update_plex_state(struct gv_plex *p) { int sdstates; + int oldstate; KASSERT(p != NULL, ("gv_update_plex_state: NULL p")); + oldstate = p->state; + /* First, check the state of our subdisks. */ sdstates = gv_sdstatemap(p); @@ -314,7 +323,10 @@ gv_update_plex_state(struct gv_plex *p) } else p->state = GV_PLEX_DOWN; - printf("GEOM_VINUM: plex %s is %s\n", p->name, gv_plexstate(p->state)); + if (p->state != oldstate) + printf("GEOM_VINUM: plex %s state change: %s -> %s\n", p->name, + gv_plexstate(oldstate), gv_plexstate(p->state)); + /* Update our volume, if we have one. */ if (p->vol_sc != NULL) gv_update_vol_state(p->vol_sc); |