9 fprint(2, "usage: syncindex [-fv] [-B blockcachesize] config\n");
10 threadexitsall("usage");
16 threadmain(int argc, char *argv[])
26 bcmem = unittoull(EARGF(usage()));
29 icmem = unittoull(EARGF(usage()));
49 if(initventi(argv[0], &conf) < 0)
50 sysfatal("can't init venti: %r");
52 if(bcmem < maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16))
53 bcmem = maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16);
54 if(0) fprint(2, "initialize %d bytes of disk block cache\n", bcmem);
56 initlumpcache(1*1024*1024, 1024/8);
57 icmem = u64log2(icmem / (sizeof(IEntry)+sizeof(IEntry*)) / ICacheDepth);
60 if(1) fprint(2, "initialize %d bytes of index cache for %d index entries\n",
61 (sizeof(IEntry)+sizeof(IEntry*)) * (1 << icmem) * ICacheDepth,
62 (1 << icmem) * ICacheDepth);
63 initicache(icmem, ICacheDepth);
66 startbloomproc(mainindex->bloom);
69 printindex(2, mainindex);
70 if(syncindex(mainindex, fix, 1, 0) < 0)
71 sysfatal("failed to sync index=%s: %r\n", mainindex->name);