From 082eb6999014ff2e7e0043cb5500e9a3f00f79c3 Mon Sep 17 00:00:00 2001 From: le Date: Fri, 21 Jan 2005 18:27:23 +0000 Subject: Only report state changes of subdisks and plexes when there's really a state change. Reword the info a bit. --- sys/geom/vinum/geom_vinum_state.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sys/geom/vinum') 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); -- cgit v1.1