diff options
author | Russ Cox <rsc@swtch.com> | 2007-09-25 09:47:31 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2007-09-25 09:47:31 -0400 |
commit | 7a400ee957a0815287af806e18ef90dd18b47f82 (patch) | |
tree | 023076fb829f630384f2f394eb9577a81fdca59e /src/cmd/venti/srv/venti.c | |
parent | 25a4e89fa907ed5a5f5d84eccfb66180007d9c68 (diff) | |
download | plan9port-7a400ee957a0815287af806e18ef90dd18b47f82.tar.gz plan9port-7a400ee957a0815287af806e18ef90dd18b47f82.tar.bz2 plan9port-7a400ee957a0815287af806e18ef90dd18b47f82.zip |
venti: new icache
Diffstat (limited to 'src/cmd/venti/srv/venti.c')
-rw-r--r-- | src/cmd/venti/srv/venti.c | 21 |
1 files changed, 8 insertions, 13 deletions
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); } - - |