plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit e7e953b3dadb5aba3bb2f3f05b2beff94934a4dc
parent a2df31f46d2119bf79d5b0e0fba07cef4564abcc
Author: Russ Cox <rsc@swtch.com>
Date:   Sun, 22 Apr 2012 15:27:06 -0400

venti: add bootstrap mode (write + no index)

R=rsc, rsc
http://codereview.appspot.com/6097047

Diffstat:
Msrc/cmd/venti/srv/dat.h | 1+
Msrc/cmd/venti/srv/httpd.c | 1+
Msrc/cmd/venti/srv/icache.c | 6++++++
Msrc/cmd/venti/srv/lump.c | 1+
4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/cmd/venti/srv/dat.h b/src/cmd/venti/srv/dat.h @@ -740,6 +740,7 @@ extern Stats stats; extern u8int zeroscore[VtScoreSize]; extern int compressblocks; extern int writestodevnull; /* dangerous - for performance debugging */ +extern int bootstrap; /* writes but does not index - cannot read */ extern int collectstats; extern QLock memdrawlock; extern int icachesleeptime; diff --git a/src/cmd/venti/srv/httpd.c b/src/cmd/venti/srv/httpd.c @@ -396,6 +396,7 @@ static struct "ignorebloom", &ignorebloom, "syncwrites", &syncwrites, "icacheprefetch", &icacheprefetch, + "bootstrap", &bootstrap, 0 }; diff --git a/src/cmd/venti/srv/icache.c b/src/cmd/venti/srv/icache.c @@ -387,6 +387,9 @@ icachelookup(u8int score[VtScoreSize], int type, IAddr *ia) { IEntry *ie; + if(bootstrap) + return -1; + qlock(&icache.lock); addstat(StatIcacheLookup, 1); if((ie = ihashlookup(icache.hash, score, type)) != nil){ @@ -417,6 +420,9 @@ insertscore(u8int score[VtScoreSize], IAddr *ia, int state, AState *as) { ISum *toload; + if(bootstrap) + return -1; + qlock(&icache.lock); icacheinsert(score, ia, state); if(state == IEClean) diff --git a/src/cmd/venti/srv/lump.c b/src/cmd/venti/srv/lump.c @@ -2,6 +2,7 @@ #include "dat.h" #include "fns.h" +int bootstrap = 0; int syncwrites = 0; int queuewrites = 0; int writestodevnull = 0;