From 27d28098203579f0735ba6400641e9be94eb12f8 Mon Sep 17 00:00:00 2001 From: rsc Date: Sat, 21 Apr 2007 19:40:55 +0000 Subject: sync with mit plan 9 version --- src/cmd/venti/srv/lump.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/cmd/venti/srv/lump.c') 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, -- cgit v1.2.3