From 7a400ee957a0815287af806e18ef90dd18b47f82 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 25 Sep 2007 09:47:31 -0400 Subject: venti: new icache --- src/cmd/venti/srv/venti.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/cmd/venti/srv/venti.c') diff --git a/src/cmd/venti/srv/venti.c b/src/cmd/venti/srv/venti.c index fab83782..4d59dfc6 100644 --- a/src/cmd/venti/srv/venti.c +++ b/src/cmd/venti/srv/venti.c @@ -18,7 +18,7 @@ static void ventiserver(void*); void usage(void) { - fprint(2, "usage: venti [-Ldrs] [-a ventiaddr] [-c config] " + fprint(2, "usage: venti [-Ldrsw] [-a ventiaddr] [-c config] " "[-h httpaddr] [-B blockcachesize] [-C cachesize] [-I icachesize] [-W webroot]\n"); threadexitsall("usage"); } @@ -73,6 +73,9 @@ threadmain(int argc, char *argv[]) case 's': nofork = 1; break; + case 'w': /* compatibility with old venti */ + queuewrites = 1; + break; case 'W': webroot = EARGF(usage()); break; @@ -103,9 +106,6 @@ threadmain(int argc, char *argv[]) if(configfile == nil) configfile = "venti.conf"; - if(initarenasum() < 0) - fprint(2, "warning: can't initialize arena summing process: %r"); - fprint(2, "conf..."); if(initventi(configfile, &config) < 0) sysfatal("can't init server: %r"); @@ -143,13 +143,7 @@ threadmain(int argc, char *argv[]) mem, mem / (8 * 1024)); initlumpcache(mem, mem / (8 * 1024)); - icmem = u64log2(icmem / (sizeof(IEntry)+sizeof(IEntry*)) / ICacheDepth); - if(icmem < 4) - icmem = 4; - if(0) fprint(2, "initialize %d bytes of index cache for %d index entries\n", - (sizeof(IEntry)+sizeof(IEntry*)) * (1 << icmem) * ICacheDepth, - (1 << icmem) * ICacheDepth); - initicache(icmem, ICacheDepth); + initicache(icmem); initicachewrite(); /* @@ -179,6 +173,9 @@ threadmain(int argc, char *argv[]) } } + if(initarenasum() < 0) + fprint(2, "warning: can't initialize arena summing process: %r"); + fprint(2, "announce %s...", vaddr); ventisrv = vtlisten(vaddr); if(ventisrv == nil) @@ -272,5 +269,3 @@ ventiserver(void *v) flushicache(); threadexitsall(0); } - - -- cgit v1.2.3