Commits

Russ Cox committed a615f29

venti: add bootstrap mode (write + no index)

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

Comments (0)

Files changed (4)

src/cmd/venti/srv/dat.h

 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;

src/cmd/venti/srv/httpd.c

 	"ignorebloom",	&ignorebloom,
 	"syncwrites",	&syncwrites,
 	"icacheprefetch",	&icacheprefetch,
+	"bootstrap",	&bootstrap,
 	0
 };
 

src/cmd/venti/srv/icache.c

 {
 	IEntry *ie;
 
+	if(bootstrap)
+		return -1;
+
 	qlock(&icache.lock);
 	addstat(StatIcacheLookup, 1);
 	if((ie = ihashlookup(icache.hash, score, type)) != nil){
 {
 	ISum *toload;
 
+	if(bootstrap)
+		return -1;
+
 	qlock(&icache.lock);
 	icacheinsert(score, ia, state);
 	if(state == IEClean)

src/cmd/venti/srv/lump.c

 #include "dat.h"
 #include "fns.h"
 
+int			bootstrap = 0;
 int			syncwrites = 0;
 int			queuewrites = 0;
 int			writestodevnull = 0;