summaryrefslogtreecommitdiffstats
path: root/sys/geom/nop
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2013-04-13 19:02:58 +0000
committerjmg <jmg@FreeBSD.org>2013-04-13 19:02:58 +0000
commitb9f17d62db67c67d9d2177347bc75b306530943b (patch)
treefa89b1979ca3a3c03d7f7caccb6d0d990f2c2276 /sys/geom/nop
parent7117978a81489c8738730dfa94f7b7544868a517 (diff)
downloadFreeBSD-src-b9f17d62db67c67d9d2177347bc75b306530943b.zip
FreeBSD-src-b9f17d62db67c67d9d2177347bc75b306530943b.tar.gz
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
Diffstat (limited to 'sys/geom/nop')
-rw-r--r--sys/geom/nop/g_nop.c2
-rw-r--r--sys/geom/nop/g_nop.h7
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c
index 7378266..0cb0374 100644
--- a/sys/geom/nop/g_nop.c
+++ b/sys/geom/nop/g_nop.c
@@ -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;
}
diff --git a/sys/geom/nop/g_nop.h b/sys/geom/nop/g_nop.h
index 4bfc4e1..da555ec 100644
--- a/sys/geom/nop/g_nop.h
+++ b/sys/geom/nop/g_nop.h
@@ -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); \
OpenPOWER on IntegriCloud