svn commit: r184292 - head/sys/geom/vinum

Ulf Lilleengen lulf at FreeBSD.org
Sun Oct 26 10:20:37 PDT 2008


Author: lulf
Date: Sun Oct 26 17:20:37 2008
New Revision: 184292
URL: http://svn.freebsd.org/changeset/base/184292

Log:
  - Import macros used in gmirror for printing gvinum debug messages and making
    the output more standardized.
  - Add a sysctl to set the verbosity of the debug messages.
  - While there, fixup typos and wording in the messages.

Modified:
  head/sys/geom/vinum/geom_vinum.c
  head/sys/geom/vinum/geom_vinum.h
  head/sys/geom/vinum/geom_vinum_drive.c
  head/sys/geom/vinum/geom_vinum_init.c
  head/sys/geom/vinum/geom_vinum_plex.c
  head/sys/geom/vinum/geom_vinum_raid5.c
  head/sys/geom/vinum/geom_vinum_rm.c
  head/sys/geom/vinum/geom_vinum_state.c
  head/sys/geom/vinum/geom_vinum_subr.c
  head/sys/geom/vinum/geom_vinum_volume.c

Modified: head/sys/geom/vinum/geom_vinum.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/malloc.h>
 #include <sys/module.h>
 #include <sys/mutex.h>
+#include <sys/sysctl.h>
 #include <sys/systm.h>
 
 #include <geom/geom.h>
@@ -42,12 +43,12 @@ __FBSDID("$FreeBSD$");
 #include <geom/vinum/geom_vinum.h>
 #include <geom/vinum/geom_vinum_share.h>
 
-#if 0
 SYSCTL_DECL(_kern_geom);
 SYSCTL_NODE(_kern_geom, OID_AUTO, vinum, CTLFLAG_RW, 0, "GEOM_VINUM stuff");
-SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RW, &gv_debug, 0,
+u_int g_vinum_debug = 0;
+TUNABLE_INT("kern.geom.vinum.debug", &g_vinum_debug);
+SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RW, &g_vinum_debug, 0,
     "Debug level");
-#endif
 
 int	gv_create(struct g_geom *, struct gctl_req *);
 
@@ -363,7 +364,7 @@ gv_create(struct g_geom *gp, struct gctl
 			 */
 			pp = g_provider_by_name(d->device);
 			if (pp == NULL) {
-				printf("geom_vinum: %s: drive disapeared?\n",
+				G_VINUM_DEBUG(0, "%s: drive disappeared?",
 				    d->device);
 				continue;
 			}

Modified: head/sys/geom/vinum/geom_vinum.h
==============================================================================
--- head/sys/geom/vinum/geom_vinum.h	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum.h	Sun Oct 26 17:20:37 2008	(r184292)
@@ -96,4 +96,30 @@ void	gv_update_vol_size(struct gv_volume
 off_t	gv_vol_size(struct gv_volume *);
 off_t	gv_plex_size(struct gv_plex *);
 
+extern	u_int	g_vinum_debug;
+
+#define	G_VINUM_DEBUG(lvl, ...)	do {					\
+	if (g_vinum_debug >= (lvl)) {					\
+		printf("GEOM_VINUM");					\
+		if (g_vinum_debug > 0)					\
+			printf("[%u]", lvl);				\
+		printf(": ");						\
+		printf(__VA_ARGS__);					\
+		printf("\n");						\
+	}								\
+} while (0)
+
+#define	G_VINUM_LOGREQ(lvl, bp, ...)	do {				\
+	if (g_vinum_debug >= (lvl)) {					\
+		printf("GEOM_VINUM");					\
+		if (g_vinum_debug > 0)					\
+			printf("[%u]", lvl);				\
+		printf(": ");						\
+		printf(__VA_ARGS__);					\
+		printf(" ");						\
+		g_print_bio(bp);					\
+		printf("\n");						\
+	}								\
+} while (0)
+
 #endif /* !_GEOM_VINUM_H_ */

Modified: head/sys/geom/vinum/geom_vinum_drive.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_drive.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_drive.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -172,7 +172,7 @@ gv_read_header(struct g_consumer *cp, st
 		g_free(d_hdr);
 		return (-1);
 	} else if (gv_legacy_header_type(d_hdr, be) == GV_LEGACY_SPARC64) {
-		printf("VINUM: detected legacy sparc64 header\n");
+		G_VINUM_DEBUG(1, "detected legacy sparc64 header");
 		m_hdr->magic = GV_MAGIC;
 		/* Legacy sparc64 on-disk header */
 		m_hdr->config_length = GV_GET64(be);
@@ -186,7 +186,7 @@ gv_read_header(struct g_consumer *cp, st
 		m_hdr->label.last_update.tv_usec = GV_GET64(be);
 		m_hdr->label.drive_size = GV_GET64(be);
 	} else if (gv_legacy_header_type(d_hdr, be) == GV_LEGACY_POWERPC) {
-		printf("VINUM: detected legacy PowerPC header\n");
+		G_VINUM_DEBUG(1, "detected legacy PowerPC header");
 		m_hdr->magic = GV_MAGIC;
 		/* legacy 32-bit big endian on-disk header */
 		m_hdr->config_length = GV_GET32(be);
@@ -200,7 +200,7 @@ gv_read_header(struct g_consumer *cp, st
 		m_hdr->label.last_update.tv_usec = GV_GET32(be);
 		m_hdr->label.drive_size = GV_GET64(be);
 	} else if (gv_legacy_header_type(d_hdr, be) == GV_LEGACY_I386) {
-		printf("VINUM: detected legacy i386 header\n");
+		G_VINUM_DEBUG(1, "detected legacy i386 header");
 		m_hdr->magic = GV_MAGIC;
 		/* legacy i386 on-disk header */
 		m_hdr->config_length = GV_GET32(le);
@@ -214,7 +214,7 @@ gv_read_header(struct g_consumer *cp, st
 		m_hdr->label.last_update.tv_usec = GV_GET32(le);
 		m_hdr->label.drive_size = GV_GET64(le);
 	} else {
-		printf("VINUM: detected legacy amd64 header\n");
+		G_VINUM_DEBUG(1, "detected legacy amd64 header");
 		m_hdr->magic = GV_MAGIC;
 		/* legacy amd64 on-disk header */
 		m_hdr->config_length = GV_GET64(le);
@@ -354,7 +354,7 @@ gv_save_config(struct g_consumer *cp, st
 
 	hdr = d->hdr;
 	if (hdr == NULL) {
-		printf("GEOM_VINUM: drive %s has NULL hdr\n", d->name);
+		G_VINUM_DEBUG(0, "drive %s has NULL hdr", d->name);
 		g_free(vhdr);
 		return;
 	}
@@ -367,7 +367,7 @@ gv_save_config(struct g_consumer *cp, st
 
 	error = g_access(cp2, 0, 1, 0);
 	if (error) {
-		printf("GEOM_VINUM: g_access failed on drive %s, errno %d\n",
+		G_VINUM_DEBUG(0, "g_access failed on drive %s, errno %d",
 		    d->name, error);
 		sbuf_delete(sb);
 		g_free(vhdr);
@@ -378,7 +378,7 @@ gv_save_config(struct g_consumer *cp, st
 	do {
 		error = gv_write_header(cp2, vhdr);
 		if (error) {
-			printf("GEOM_VINUM: writing vhdr failed on drive %s, "
+			G_VINUM_DEBUG(0, "writing vhdr failed on drive %s, "
 			    "errno %d", d->name, error);
 			break;
 		}
@@ -386,7 +386,7 @@ gv_save_config(struct g_consumer *cp, st
 		error = g_write_data(cp2, GV_CFG_OFFSET, sbuf_data(sb),
 		    GV_CFG_LEN);
 		if (error) {
-			printf("GEOM_VINUM: writing first config copy failed "
+			G_VINUM_DEBUG(0, "writing first config copy failed "
 			    "on drive %s, errno %d", d->name, error);
 			break;
 		}
@@ -394,7 +394,7 @@ gv_save_config(struct g_consumer *cp, st
 		error = g_write_data(cp2, GV_CFG_OFFSET + GV_CFG_LEN,
 		    sbuf_data(sb), GV_CFG_LEN);
 		if (error)
-			printf("GEOM_VINUM: writing second config copy failed "
+			G_VINUM_DEBUG(0, "writing second config copy failed "
 			    "on drive %s, errno %d", d->name, error);
 	} while (0);
 
@@ -836,8 +836,8 @@ gv_drive_dead(void *arg, int flag)
 
 	LIST_FOREACH(cp, &gp->consumer, consumer) {
 		if (cp->nstart != cp->nend) {
-			printf("GEOM_VINUM: dead drive '%s' has still "
-			    "active requests, can't detach consumer\n",
+			G_VINUM_DEBUG(0, "dead drive '%s' still has "
+			    "active requests, cannot detach consumer",
 			    d->name);
 			g_post_event(gv_drive_dead, d, M_WAITOK, d,
 			    NULL);
@@ -847,7 +847,7 @@ gv_drive_dead(void *arg, int flag)
 			g_access(cp, -cp->acr, -cp->acw, -cp->ace);
 	}
 
-	printf("GEOM_VINUM: lost drive '%s'\n", d->name);
+	G_VINUM_DEBUG(1, "lost drive '%s'", d->name);
 	d->geom = NULL;
 	LIST_FOREACH(s, &d->subdisks, from_drive) {
 		s->provider = NULL;

Modified: head/sys/geom/vinum/geom_vinum_init.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_init.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_init.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -420,15 +420,15 @@ gv_rebuild_td(void *arg)
 	error = g_access(cp, 1, 1, 0);
 	if (error) {
 		g_topology_unlock();
-		printf("GEOM_VINUM: rebuild of %s failed to access consumer: "
-		    "%d\n", p->name, error);
+		G_VINUM_DEBUG(0, "rebuild of %s failed to access consumer: "
+		    "%d", p->name, error);
 		kproc_exit(error);
 	}
 	g_topology_unlock();
 
 	buf = g_malloc(sync->syncsize, M_WAITOK);
 
-	printf("GEOM_VINUM: rebuild of %s started\n", p->name);
+	G_VINUM_DEBUG(1, "rebuild of %s started", p->name);
 	i = 0;
 	for (i = 0; i < p->size; i += (p->stripesize * (p->sdcount - 1))) {
 /*
@@ -437,8 +437,8 @@ gv_rebuild_td(void *arg)
 */
 		bp = g_new_bio();
 		if (bp == NULL) {
-			printf("GEOM_VINUM: rebuild of %s failed creating bio: "
-			    "out of memory\n", p->name);
+			G_VINUM_DEBUG(0, "rebuild of %s failed creating bio: "
+			    "out of memory", p->name);
 			break;
 		}
 		bp->bio_cmd = BIO_WRITE;
@@ -454,8 +454,8 @@ gv_rebuild_td(void *arg)
 		/* ... and wait for the result. */
 		error = biowait(bp, "gwrite");
 		if (error) {
-			printf("GEOM_VINUM: rebuild of %s failed at offset %jd "
-			    "errno: %d\n", p->name, i, error);
+			G_VINUM_DEBUG(0, "rebuild of %s failed at offset %jd "
+			    "errno: %d", p->name, i, error);
 			break;
 		}
 		g_destroy_bio(bp);
@@ -477,7 +477,7 @@ gv_rebuild_td(void *arg)
 
 	/* Successful initialization. */
 	if (!error)
-		printf("GEOM_VINUM: rebuild of %s finished\n", p->name);
+		G_VINUM_DEBUG(1, "rebuild of %s finished", p->name);
 
 	g_free(sync);
 	kproc_exit(error);
@@ -508,8 +508,8 @@ gv_sync_td(void *arg)
 	error = g_access(from, 1, 0, 0);
 	if (error) {
 		g_topology_unlock();
-		printf("GEOM_VINUM: sync from '%s' failed to access "
-		    "consumer: %d\n", sync->from->name, error);
+		G_VINUM_DEBUG(0, "sync from '%s' failed to access "
+		    "consumer: %d", sync->from->name, error);
 		g_free(sync);
 		kproc_exit(error);
 	}
@@ -517,21 +517,21 @@ gv_sync_td(void *arg)
 	if (error) {
 		g_access(from, -1, 0, 0);
 		g_topology_unlock();
-		printf("GEOM_VINUM: sync to '%s' failed to access "
-		    "consumer: %d\n", p->name, error);
+		G_VINUM_DEBUG(0, "sync to '%s' failed to access "
+		    "consumer: %d", p->name, error);
 		g_free(sync);
 		kproc_exit(error);
 	}
 	g_topology_unlock();
 
-	printf("GEOM_VINUM: plex sync %s -> %s started\n", sync->from->name,
+	G_VINUM_DEBUG(1, "plex sync %s -> %s started", sync->from->name,
 	    sync->to->name);
 	for (i = 0; i < p->size; i+= sync->syncsize) {
 		/* Read some bits from the good plex. */
 		buf = g_read_data(from, i, sync->syncsize, &error);
 		if (buf == NULL) {
-			printf("GEOM_VINUM: sync read from '%s' failed at "
-			    "offset %jd; errno: %d\n", sync->from->name, i,
+			G_VINUM_DEBUG(0, "sync read from '%s' failed at "
+			    "offset %jd; errno: %d", sync->from->name, i,
 			    error);
 			break;
 		}
@@ -544,8 +544,8 @@ gv_sync_td(void *arg)
 		 */
 		bp = g_new_bio();
 		if (bp == NULL) {
-			printf("GEOM_VINUM: sync write to '%s' failed at "
-			    "offset %jd; out of memory\n", p->name, i);
+			G_VINUM_DEBUG(0, "sync write to '%s' failed at "
+			    "offset %jd; out of memory", p->name, i);
 			g_free(buf);
 			break;
 		}
@@ -569,7 +569,7 @@ gv_sync_td(void *arg)
 		g_destroy_bio(bp);
 		g_free(buf);
 		if (error) {
-			printf("GEOM_VINUM: sync write to '%s' failed at "
+			G_VINUM_DEBUG(0, "sync write to '%s' failed at "
 			    "offset %jd; errno: %d\n", p->name, i, error);
 			break;
 		}
@@ -586,7 +586,7 @@ gv_sync_td(void *arg)
 
 	/* Successful initialization. */
 	if (!error)
-		printf("GEOM_VINUM: plex sync %s -> %s finished\n",
+		G_VINUM_DEBUG(1, "plex sync %s -> %s finished",
 		    sync->from->name, sync->to->name);
 
 	p->flags &= ~GV_PLEX_SYNCING;
@@ -630,8 +630,8 @@ gv_init_td(void *arg)
 	if (error) {
 		s->init_error = error;
 		g_topology_unlock();
-		printf("GEOM_VINUM: subdisk '%s' init: failed to access "
-		    "consumer; error: %d\n", s->name, error);
+		G_VINUM_DEBUG(0, "subdisk '%s' init: failed to access "
+		    "consumer; error: %d", s->name, error);
 		kproc_exit(error);
 	}
 	g_topology_unlock();
@@ -639,8 +639,8 @@ gv_init_td(void *arg)
 	for (i = start; i < offset + length; i += init_size) {
 		error = g_write_data(cp, i, buf, init_size);
 		if (error) {
-			printf("GEOM_VINUM: subdisk '%s' init: write failed"
-			    " at offset %jd (drive offset %jd); error %d\n",
+			G_VINUM_DEBUG(0, "subdisk '%s' init: write failed"
+			    " at offset %jd (drive offset %jd); error %d",
 			    s->name, (intmax_t)s->initialized, (intmax_t)i,
 			    error);
 			break;
@@ -664,7 +664,7 @@ gv_init_td(void *arg)
 		gv_set_sd_state(s, GV_SD_UP, GV_SETSTATE_CONFIG);
 		g_topology_unlock();
 		s->initialized = 0;
-		printf("GEOM_VINUM: subdisk '%s' init: finished successfully\n",
+		G_VINUM_DEBUG(1, "subdisk '%s' init: finished successfully",
 		    s->name);
 	}
 	kproc_exit(error);

Modified: head/sys/geom/vinum/geom_vinum_plex.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_plex.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_plex.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -189,7 +189,7 @@ gv_plexbuffer(struct gv_plex *p, struct 
 		if (!(bp->bio_cflags & GV_BIO_SYNCREQ))
 			return (ENXIO);
 
-		printf("GEOM_VINUM: sd %s is initializing\n", s->name);
+		G_VINUM_DEBUG(1, "sd %s is initializing", s->name);
 		gv_set_sd_state(s, GV_SD_INITIALIZING, GV_SETSTATE_FORCE);
 		break;
 
@@ -558,9 +558,7 @@ gv_plex_normal_request(struct gv_plex *p
 			 * clean up a lot.
  			 */
  			if (err) {
-				printf("GEOM_VINUM: plex request failed for ");
-				g_print_bio(bp);
-				printf("\n");
+				G_VINUM_LOGREQ(0, bp, "plex request failed.");
 				TAILQ_FOREACH_SAFE(bq, &wp->bits, queue, bq2) {
 					TAILQ_REMOVE(&wp->bits, bq, queue);
 					g_free(bq);
@@ -620,9 +618,7 @@ gv_plex_normal_request(struct gv_plex *p
 
 			/* Building the sub-request failed. */
 			if (err) {
-				printf("GEOM_VINUM: plex request failed for ");
-				g_print_bio(bp);
-				printf("\n");
+				G_VINUM_LOGREQ(0, bp, "plex request failed.");
 				cbp = bp->bio_driver1;
 				while (cbp != NULL) {
 					pbp = cbp->bio_caller1;
@@ -719,7 +715,7 @@ gv_plex_taste(struct g_class *mp, struct
 	/* Now find the correct plex where this subdisk belongs to. */
 	p = gv_find_plex(sc, s->plex);
 	if (p == NULL) {
-		printf("gv_plex_taste: NULL p for '%s'\n", s->name);
+		G_VINUM_DEBUG(0, "%s: NULL p for '%s'", __func__, s->name);
 		return (NULL);
 	}
 
@@ -740,7 +736,7 @@ gv_plex_taste(struct g_class *mp, struct
 		cp = g_new_consumer(gp);
 		error = g_attach(cp, pp);
 		if (error) {
-			printf("geom_vinum: couldn't attach consumer to %s\n",
+			G_VINUM_DEBUG(0, "unable to attach consumer to %s",
 			    pp->name);
 			g_destroy_consumer(cp);
 			return (NULL);
@@ -749,8 +745,8 @@ gv_plex_taste(struct g_class *mp, struct
 		if ((cp2 != NULL) && (cp2->acr || cp2->acw || cp2->ace)) {
 			error = g_access(cp, cp2->acr, cp2->acw, cp2->ace);
 			if (error) {
-				printf("geom_vinum: couldn't set access counts"
-				    " for consumer on %s\n", pp->name);
+				G_VINUM_DEBUG(0, "unable to set access counts"
+				    " for consumer on %s", pp->name);
 				g_detach(cp);
 				g_destroy_consumer(cp);
 				return (NULL);

Modified: head/sys/geom/vinum/geom_vinum_raid5.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_raid5.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_raid5.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -208,7 +208,7 @@ gv_rebuild_raid5(struct gv_plex *p, stru
 		if (!(bp->bio_cflags & GV_BIO_REBUILD))
 			return (ENXIO);
 
-		printf("GEOM_VINUM: sd %s is reviving\n", broken->name);
+		G_VINUM_DEBUG(1, "sd %s is reviving", broken->name);
 		gv_set_sd_state(broken, GV_SD_REVIVING, GV_SETSTATE_FORCE);
 		break;
 

Modified: head/sys/geom/vinum/geom_vinum_rm.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_rm.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_rm.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -351,8 +351,8 @@ gv_rm_drive(struct gv_softc *sc, struct 
 	cp = LIST_FIRST(&gp->consumer);
 	err = g_access(cp, 0, 1, 0);
 	if (err) {
-		printf("GEOM_VINUM: gv_rm_drive: couldn't access '%s', errno: "
-		    "%d\n", cp->provider->name, err);
+		G_VINUM_DEBUG(0, "%s: unable to access '%s', errno: "
+		    "%d", __func__, cp->provider->name, err);
 		return (err);
 	}
 
@@ -361,8 +361,8 @@ gv_rm_drive(struct gv_softc *sc, struct 
 	g_topology_unlock();
 	err = gv_write_header(cp, d->hdr);
 	if (err) {
-		printf("GEOM_VINUM: gv_rm_drive: couldn't write header to '%s'"
-		    ", errno: %d\n", cp->provider->name, err);
+		G_VINUM_DEBUG(0, "%s: unable to write header to '%s'"
+		    ", errno: %d", __func__, cp->provider->name, err);
 		d->hdr->magic = GV_MAGIC;
 	}
 	g_topology_lock();

Modified: head/sys/geom/vinum/geom_vinum_state.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_state.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_state.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -280,8 +280,8 @@ gv_update_sd_state(struct gv_sd *s)
 		s->state = GV_SD_UP;
 	
 	if (s->state != oldstate)
-		printf("GEOM_VINUM: subdisk %s state change: %s -> %s\n",
-		    s->name, gv_sdstate(oldstate), gv_sdstate(s->state));
+		G_VINUM_DEBUG(1, "subdisk %s state change: %s -> %s", s->name,
+		    gv_sdstate(oldstate), gv_sdstate(s->state));
 
 	/* Update the plex, if we have one. */
 	if (s->plex_sc != NULL)
@@ -324,7 +324,7 @@ gv_update_plex_state(struct gv_plex *p)
 		p->state = GV_PLEX_DOWN;
 
 	if (p->state != oldstate)
-		printf("GEOM_VINUM: plex %s state change: %s -> %s\n", p->name,
+		G_VINUM_DEBUG(1, "plex %s state change: %s -> %s", p->name,
 		    gv_plexstate(oldstate), gv_plexstate(p->state));
 
 	/* Update our volume, if we have one. */

Modified: head/sys/geom/vinum/geom_vinum_subr.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_subr.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_subr.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -113,7 +113,7 @@ gv_parse_config(struct gv_softc *sc, u_c
 			if (!strcmp(token[0], "volume")) {
 				v = gv_new_volume(tokens, token);
 				if (v == NULL) {
-					printf("geom_vinum: failed volume\n");
+					G_VINUM_DEBUG(0, "failed volume");
 					break;
 				}
 
@@ -132,7 +132,7 @@ gv_parse_config(struct gv_softc *sc, u_c
 			} else if (!strcmp(token[0], "plex")) {
 				p = gv_new_plex(tokens, token);
 				if (p == NULL) {
-					printf("geom_vinum: failed plex\n");
+					G_VINUM_DEBUG(0, "failed plex");
 					break;
 				}
 
@@ -152,7 +152,7 @@ gv_parse_config(struct gv_softc *sc, u_c
 				s = gv_new_sd(tokens, token);
 
 				if (s == NULL) {
-					printf("geom_vinum: failed subdisk\n");
+					G_VINUM_DEBUG(0, "failed subdisk");
 					break;
 				}
 
@@ -265,8 +265,8 @@ gv_sd_to_plex(struct gv_plex *p, struct 
 	/* Check correct size of this subdisk. */
 	s2 = LIST_FIRST(&p->subdisks);
 	if (s2 != NULL && gv_is_striped(p) && (s2->size != s->size)) {
-		printf("GEOM_VINUM: need equal sized subdisks for "
-		    "this plex organisation - %s (%jd) <-> %s (%jd)\n",
+		G_VINUM_DEBUG(0, "need equal sized subdisks for "
+		    "this plex organisation - %s (%jd) <-> %s (%jd)",
 		    s2->name, s2->size, s->name, s->size);
 		return (-1);
 	}
@@ -439,8 +439,8 @@ gv_update_plex_config(struct gv_plex *p)
 		s = LIST_FIRST(&p->subdisks);
 		LIST_FOREACH(s2, &p->subdisks, in_plex) {
 			if (s->size != s2->size) {
-				printf("geom_vinum: subdisk size mismatch "
-				    "%s (%jd) <> %s (%jd)\n", s->name, s->size,
+				G_VINUM_DEBUG(0, "subdisk size mismatch %s"
+				    "(%jd) <> %s (%jd)", s->name, s->size,
 				    s2->name, s2->size);
 				state = GV_PLEX_DOWN;
 			}
@@ -450,10 +450,9 @@ gv_update_plex_config(struct gv_plex *p)
 		LIST_FOREACH(s, &p->subdisks, in_plex) {
 			remainder = s->size % p->stripesize;
 			if (remainder) {
-				printf("gvinum: size of sd %s is not a "
+				G_VINUM_DEBUG(1, "size of sd %s is not a "
 				    "multiple of plex stripesize, taking off "
-				    "%jd bytes\n", s->name,
-				    (intmax_t)remainder);
+				    "%jd bytes", s->name, (intmax_t)remainder);
 				gv_adjust_freespace(s, remainder);
 			}
 		}
@@ -544,7 +543,7 @@ gv_sd_to_drive(struct gv_softc *sc, stru
 
 		/* No good slot found? */
 		if (s->size == -1) {
-			snprintf(errstr, errlen, "couldn't autosize '%s' on "
+			snprintf(errstr, errlen, "could not autosize '%s' on "
 			    "'%s'", s->name, d->name);
 			return (-1);
 		}

Modified: head/sys/geom/vinum/geom_vinum_volume.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_volume.c	Sun Oct 26 17:03:51 2008	(r184291)
+++ head/sys/geom/vinum/geom_vinum_volume.c	Sun Oct 26 17:20:37 2008	(r184292)
@@ -385,8 +385,8 @@ gv_volume_taste(struct g_class *mp, stru
 	if ((ocp != NULL) && (ocp->acr > 0 || ocp->acw > 0 || ocp->ace > 0)) {
 		error = g_access(cp, ocp->acr, ocp->acw, ocp->ace);
 		if (error) {
-			printf("GEOM_VINUM: failed g_access %s -> %s; "
-			    "errno %d\n", v->name, p->name, error);
+			G_VINUM_DEBUG(0, "failed g_access %s -> %s; "
+			    "errno %d", v->name, p->name, error);
 			g_detach(cp);
 			g_destroy_consumer(cp);
 			if (first)


More information about the svn-src-head mailing list