svn commit: r249440 - head/sys/geom/nop

John-Mark Gurney jmg at FreeBSD.org
Sat Apr 13 19:02:58 UTC 2013


Author: jmg
Date: Sat Apr 13 19:02:58 2013
New Revision: 249440
URL: http://svnweb.freebsd.org/changeset/base/249440

Log:
  move the error report to a lower log level...  Now you can see when it
  returns an error without getting every single io that went through it..
  
  MFC after:	1 week

Modified:
  head/sys/geom/nop/g_nop.c
  head/sys/geom/nop/g_nop.h

Modified: head/sys/geom/nop/g_nop.c
==============================================================================
--- head/sys/geom/nop/g_nop.c	Sat Apr 13 15:20:33 2013	(r249439)
+++ head/sys/geom/nop/g_nop.c	Sat Apr 13 19:02:58 2013	(r249440)
@@ -124,7 +124,7 @@ g_nop_start(struct bio *bp)
 
 		rval = arc4random() % 100;
 		if (rval < failprob) {
-			G_NOP_LOGREQ(bp, "Returning error=%d.", sc->sc_error);
+			G_NOP_LOGREQLVL(1, bp, "Returning error=%d.", sc->sc_error);
 			g_io_deliver(bp, sc->sc_error);
 			return;
 		}

Modified: head/sys/geom/nop/g_nop.h
==============================================================================
--- head/sys/geom/nop/g_nop.h	Sat Apr 13 15:20:33 2013	(r249439)
+++ head/sys/geom/nop/g_nop.h	Sat Apr 13 19:02:58 2013	(r249440)
@@ -44,9 +44,10 @@
 		printf("\n");						\
 	}								\
 } while (0)
-#define	G_NOP_LOGREQ(bp, ...)	do {					\
-	if (g_nop_debug >= 2) {						\
-		printf("GEOM_NOP[2]: ");				\
+#define	G_NOP_LOGREQ(bp, ...)	G_NOP_LOGREQLVL(2, bp, __VA_ARGS__)
+#define G_NOP_LOGREQLVL(lvl, bp, ...) do {				\
+	if (g_nop_debug >= (lvl)) {					\
+		printf("GEOM_NOP[%d]: ", (lvl));			\
 		printf(__VA_ARGS__);					\
 		printf(" ");						\
 		g_print_bio(bp);					\


More information about the svn-src-all mailing list