aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vac
diff options
context:
space:
mode:
authorDavid Swasey <david.swasey@gmail.com>2010-04-13 13:18:45 -0700
committerRuss Cox <rsc@swtch.com>2010-04-13 13:18:45 -0700
commit01f6cb233fac196c5bf4ccab71fa347d8bd67c63 (patch)
tree38a621134e8e42ddcb98a6f52a360e9a26408cfb /src/cmd/vac
parent7771477e15d445613891c408a4f4d528f35ab549 (diff)
downloadplan9port-01f6cb233fac196c5bf4ccab71fa347d8bd67c63.tar.gz
plan9port-01f6cb233fac196c5bf4ccab71fa347d8bd67c63.tar.bz2
plan9port-01f6cb233fac196c5bf4ccab71fa347d8bd67c63.zip
vac: debug prints
R=rsc CC=codebot http://codereview.appspot.com/816041
Diffstat (limited to 'src/cmd/vac')
-rw-r--r--src/cmd/vac/file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/vac/file.c b/src/cmd/vac/file.c
index d73934e8..ac7d4a2a 100644
--- a/src/cmd/vac/file.c
+++ b/src/cmd/vac/file.c
@@ -1788,7 +1788,7 @@ vacfsopen(VtConn *z, char *file, int mode, ulong cachemem)
}
close(fd);
}
-fprint(2, "vacfsopen %V\n", score);
+if(debug) fprint(2, "vacfsopen %V\n", score);
return vacfsopenscore(z, score, mode, cachemem);
}
@@ -1805,22 +1805,22 @@ vacfsopenscore(VtConn *z, u8int *score, int mode, ulong cachemem)
n = vtread(z, score, VtRootType, buf, VtRootSize);
if(n < 0) {
-fprint(2, "read %r\n");
+if(debug) fprint(2, "read %r\n");
return nil;
}
if(n != VtRootSize){
werrstr("vtread on root too short");
-fprint(2, "size %d\n", n);
+if(debug) fprint(2, "size %d\n", n);
return nil;
}
if(vtrootunpack(&rt, buf) < 0) {
-fprint(2, "unpack: %r\n");
+if(debug) fprint(2, "unpack: %r\n");
return nil;
}
if(strcmp(rt.type, "vac") != 0) {
-fprint(2, "bad type %s\n", rt.type);
+if(debug) fprint(2, "bad type %s\n", rt.type);
werrstr("not a vac root");
return nil;
}
@@ -1839,7 +1839,7 @@ fprint(2, "bad type %s\n", rt.type);
e.psize = (60000/VtEntrySize)*VtEntrySize;
e.dsize = rt.blocksize;
-fprint(2, "openscore %d psize %d dsize %d\n", (int)rt.blocksize, (int)e.psize, (int)e.dsize);
+if(debug) fprint(2, "openscore %d psize %d dsize %d\n", (int)rt.blocksize, (int)e.psize, (int)e.dsize);
e.type = VtDirType;
e.flags = VtEntryActive;
e.size = 3*VtEntrySize;
@@ -1960,7 +1960,7 @@ vacfscreate(VtConn *z, int bsize, ulong cachemem)
psize = bsize/VtScoreSize*VtScoreSize;
if(psize > 60000)
psize = 60000/VtScoreSize*VtScoreSize;
-fprint(2, "create bsize %d psize %d\n", bsize, psize);
+if(debug) fprint(2, "create bsize %d psize %d\n", bsize, psize);
f = vtfilecreateroot(fs->cache, psize, bsize, VtDirType);
if(f == nil)