venti: add bootstrap mode (write + no index)

R=rsc, rsc
http://codereview.appspot.com/6097047
This commit is contained in:
Russ Cox 2012-04-22 15:27:06 -04:00
parent a2df31f46d
commit e7e953b3da
4 changed files with 9 additions and 0 deletions

View file

@ -740,6 +740,7 @@ extern Stats stats;
extern u8int zeroscore[VtScoreSize]; extern u8int zeroscore[VtScoreSize];
extern int compressblocks; extern int compressblocks;
extern int writestodevnull; /* dangerous - for performance debugging */ extern int writestodevnull; /* dangerous - for performance debugging */
extern int bootstrap; /* writes but does not index - cannot read */
extern int collectstats; extern int collectstats;
extern QLock memdrawlock; extern QLock memdrawlock;
extern int icachesleeptime; extern int icachesleeptime;

View file

@ -396,6 +396,7 @@ static struct
"ignorebloom", &ignorebloom, "ignorebloom", &ignorebloom,
"syncwrites", &syncwrites, "syncwrites", &syncwrites,
"icacheprefetch", &icacheprefetch, "icacheprefetch", &icacheprefetch,
"bootstrap", &bootstrap,
0 0
}; };

View file

@ -387,6 +387,9 @@ icachelookup(u8int score[VtScoreSize], int type, IAddr *ia)
{ {
IEntry *ie; IEntry *ie;
if(bootstrap)
return -1;
qlock(&icache.lock); qlock(&icache.lock);
addstat(StatIcacheLookup, 1); addstat(StatIcacheLookup, 1);
if((ie = ihashlookup(icache.hash, score, type)) != nil){ if((ie = ihashlookup(icache.hash, score, type)) != nil){
@ -417,6 +420,9 @@ insertscore(u8int score[VtScoreSize], IAddr *ia, int state, AState *as)
{ {
ISum *toload; ISum *toload;
if(bootstrap)
return -1;
qlock(&icache.lock); qlock(&icache.lock);
icacheinsert(score, ia, state); icacheinsert(score, ia, state);
if(state == IEClean) if(state == IEClean)

View file

@ -2,6 +2,7 @@
#include "dat.h" #include "dat.h"
#include "fns.h" #include "fns.h"
int bootstrap = 0;
int syncwrites = 0; int syncwrites = 0;
int queuewrites = 0; int queuewrites = 0;
int writestodevnull = 0; int writestodevnull = 0;