aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2012-04-22 15:27:06 -0400
committerRuss Cox <rsc@swtch.com>2012-04-22 15:27:06 -0400
commite7e953b3dadb5aba3bb2f3f05b2beff94934a4dc (patch)
treef5d3c1283de79bcaa3fd546816a68574d3738de0 /src/cmd/venti
parenta2df31f46d2119bf79d5b0e0fba07cef4564abcc (diff)
downloadplan9port-e7e953b3dadb5aba3bb2f3f05b2beff94934a4dc.tar.gz
plan9port-e7e953b3dadb5aba3bb2f3f05b2beff94934a4dc.tar.bz2
plan9port-e7e953b3dadb5aba3bb2f3f05b2beff94934a4dc.zip
venti: add bootstrap mode (write + no index)
R=rsc, rsc http://codereview.appspot.com/6097047
Diffstat (limited to 'src/cmd/venti')
-rw-r--r--src/cmd/venti/srv/dat.h1
-rw-r--r--src/cmd/venti/srv/httpd.c1
-rw-r--r--src/cmd/venti/srv/icache.c6
-rw-r--r--src/cmd/venti/srv/lump.c1
4 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/venti/srv/dat.h b/src/cmd/venti/srv/dat.h
index 3d8e7841..f47d01a1 100644
--- 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
index 5a3f3c6f..83d80ca7 100644
--- 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
index af76819f..3055b981 100644
--- 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
index 9b244948..cc0a26dc 100644
--- 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;