aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti/srv/lump.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-04-21 19:40:55 +0000
committerrsc <devnull@localhost>2007-04-21 19:40:55 +0000
commit27d28098203579f0735ba6400641e9be94eb12f8 (patch)
tree9e0f390ced0de8c582ef3226c420daa18d16ac24 /src/cmd/venti/srv/lump.c
parent33433b3fde56d9b3ac6de6ee2584416b82bc856f (diff)
downloadplan9port-27d28098203579f0735ba6400641e9be94eb12f8.tar.gz
plan9port-27d28098203579f0735ba6400641e9be94eb12f8.tar.bz2
plan9port-27d28098203579f0735ba6400641e9be94eb12f8.zip
sync with mit plan 9 version
Diffstat (limited to 'src/cmd/venti/srv/lump.c')
-rw-r--r--src/cmd/venti/srv/lump.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/cmd/venti/srv/lump.c b/src/cmd/venti/srv/lump.c
index 13e6fe6a..1db62717 100644
--- a/src/cmd/venti/srv/lump.c
+++ b/src/cmd/venti/srv/lump.c
@@ -5,9 +5,13 @@
int syncwrites = 0;
int queuewrites = 0;
int writestodevnull = 0;
+int verifywrites = 0;
static Packet *readilump(Lump *u, IAddr *ia, u8int *score, int rac);
+/*
+ * Some of this logic is duplicated in hdisk.c
+ */
Packet*
readlump(u8int *score, int type, u32int size, int *cached)
{
@@ -133,11 +137,13 @@ writeqlump(Lump *u, Packet *p, int creator, uint ms)
int rac;
if(lookupscore(u->score, u->type, &ia, &rac) == 0){
- /* assume the data is here! XXX */
- packetfree(p);
- ms = msec() - ms;
- addstat2(StatRpcWriteOld, 1, StatRpcWriteOldTime, ms);
- return 0;
+ if(verifywrites == 0){
+ /* assume the data is here! */
+ packetfree(p);
+ ms = msec() - ms;
+ addstat2(StatRpcWriteOld, 1, StatRpcWriteOldTime, ms);
+ return 0;
+ }
/*
* if the read fails,