summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dev.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-02 07:48:39 +0000
committerphk <phk@FreeBSD.org>2002-10-02 07:48:39 +0000
commit1b32e38e4fb531e26eaf29d5df1755323646d2b7 (patch)
tree893ac3a099733ca2a9710bc337eda2c46db5cfb9 /sys/geom/geom_dev.c
parent1c84681cf9abb09d1610b99c8af08f83f752f143 (diff)
downloadFreeBSD-src-1b32e38e4fb531e26eaf29d5df1755323646d2b7.zip
FreeBSD-src-1b32e38e4fb531e26eaf29d5df1755323646d2b7.tar.gz
Put some failing ioctl related printfs under a suitable debug flag.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r--sys/geom/geom_dev.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 3ad246e..55abe74 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -301,18 +301,20 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
PICKUP_GIANT();
g_waitidle();
if (error == ENOIOCTL) {
- i = IOCGROUP(cmd);
- printf("IOCTL(0x%lx) \"%s\"", cmd, gp->name);
- if (i > ' ' && i <= '~')
- printf(" '%c'", (int)IOCGROUP(cmd));
- else
- printf(" 0x%lx", IOCGROUP(cmd));
- printf("/%ld ", cmd & 0xff);
- if (cmd & IOC_IN)
- printf("I");
- if (cmd & IOC_OUT)
- printf("O");
- printf("(%ld) = ENOIOCTL\n", IOCPARM_LEN(cmd));
+ if (g_debugflags & G_T_TOPOLOGY) {
+ i = IOCGROUP(cmd);
+ printf("IOCTL(0x%lx) \"%s\"", cmd, gp->name);
+ if (i > ' ' && i <= '~')
+ printf(" '%c'", (int)IOCGROUP(cmd));
+ else
+ printf(" 0x%lx", IOCGROUP(cmd));
+ printf("/%ld ", cmd & 0xff);
+ if (cmd & IOC_IN)
+ printf("I");
+ if (cmd & IOC_OUT)
+ printf("O");
+ printf("(%ld) = ENOIOCTL\n", IOCPARM_LEN(cmd));
+ }
error = ENOTTY;
}
return (error);
OpenPOWER on IntegriCloud