Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 2008 18:03:31 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 151968 for review
Message-ID:  <200810261803.m9QI3V47023370@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=151968

Change 151968 by trasz@trasz_victim7 on 2008/10/26 18:03:30

	IFC.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum.h#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_drive.c#5 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_init.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_plex.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_raid5.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_rm.c#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_state.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_subr.c#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_volume.c#2 integrate

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum.c,v 1.21 2006/03/30 14:01:25 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum.c,v 1.22 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -35,6 +35,7 @@
 #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 @@
 #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 @@
 			 */
 			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;
 			}

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum.h#3 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/geom/vinum/geom_vinum.h,v 1.14 2008/10/01 14:50:36 lulf Exp $
+ * $FreeBSD: src/sys/geom/vinum/geom_vinum.h,v 1.15 2008/10/26 17:20:37 lulf Exp $
  */
 
 #ifndef	_GEOM_VINUM_H_
@@ -96,4 +96,30 @@
 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_ */

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_drive.c#5 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_drive.c,v 1.31 2008/10/02 09:35:47 lulf Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_drive.c,v 1.32 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -172,7 +172,7 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 
 	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 @@
 
 	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 @@
 	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 @@
 		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 @@
 		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 @@
 
 	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 @@
 			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;

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_init.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_init.c,v 1.12 2007/10/20 23:23:20 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_init.c,v 1.13 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -420,15 +420,15 @@
 	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 @@
 */
 		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 @@
 		/* ... 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 @@
 
 	/* 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 @@
 	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 @@
 	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 @@
 		 */
 		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 @@
 		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 @@
 
 	/* 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 @@
 	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 @@
 	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_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);

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_plex.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_plex.c,v 1.18 2007/10/20 23:23:20 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_plex.c,v 1.19 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -189,7 +189,7 @@
 		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 @@
 			 * 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 @@
 
 			/* 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 @@
 	/* 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 @@
 		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 @@
 		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);

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_raid5.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_raid5.c,v 1.10 2004/11/26 11:59:51 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_raid5.c,v 1.11 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -208,7 +208,7 @@
 		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;
 

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_rm.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_rm.c,v 1.14 2008/10/02 10:01:05 lulf Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_rm.c,v 1.15 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/libkern.h>
@@ -351,8 +351,8 @@
 	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 @@
 	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();

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_state.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_state.c,v 1.8 2006/03/30 14:01:25 le Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_state.c,v 1.9 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -280,8 +280,8 @@
 		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 @@
 		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. */

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_subr.c#3 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_subr.c,v 1.17 2008/07/11 16:46:29 lulf Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_subr.c,v 1.18 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -113,7 +113,7 @@
 			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 @@
 			} 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 @@
 				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 @@
 	/* 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 @@
 		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 @@
 		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 @@
 
 		/* 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);
 		}

==== //depot/projects/soc2008/trasz_nfs4acl/sys/geom/vinum/geom_vinum_volume.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_volume.c,v 1.12 2007/10/20 23:23:20 julian Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/vinum/geom_vinum_volume.c,v 1.13 2008/10/26 17:20:37 lulf Exp $");
 
 #include <sys/param.h>
 #include <sys/bio.h>
@@ -385,8 +385,8 @@
 	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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810261803.m9QI3V47023370>