diff options
| author | rsc <devnull@localhost> | 2004-03-12 18:28:14 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-03-12 18:28:14 +0000 |
| commit | 9ffbb5adcaeec878d3b6db0f8b1f654e839b4689 (patch) | |
| tree | bfd7abf95e87e3b97f3ae2e0ae3bf59c30839cc7 /src/cmd/venti/buildindex.c | |
| parent | 7c5190d2c854128fb607289e9d83379e522c7090 (diff) | |
| download | plan9port-9ffbb5adcaeec878d3b6db0f8b1f654e839b4689.tar.gz plan9port-9ffbb5adcaeec878d3b6db0f8b1f654e839b4689.zip | |
Checkpoint.
Add disk caching code and first draft of fractional index.
Diffstat (limited to 'src/cmd/venti/buildindex.c')
| -rw-r--r-- | src/cmd/venti/buildindex.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cmd/venti/buildindex.c b/src/cmd/venti/buildindex.c index 952e75dd..8058ba09 100644 --- a/src/cmd/venti/buildindex.c +++ b/src/cmd/venti/buildindex.c @@ -7,15 +7,9 @@ writebucket(Index *ix, u32int buck, IBucket *ib, ZBlock *b) { ISect *is; - is = findisect(ix, buck); - if(is == nil){ - seterr(EAdmin, "bad math in writebucket"); + is = findibucket(ix, buck, &buck); + if(is == nil) return -1; - } - if(buck < is->start || buck >= is->stop) - seterr(EAdmin, "index write out of bounds: %d not in [%d,%d)\n", - buck, is->start, is->stop); - buck -= is->start; qlock(&stats.lock); stats.indexwrites++; qunlock(&stats.lock); @@ -47,7 +41,7 @@ buildindex(Index *ix, Part *part, u64int off, u64int clumps, int zero) ib.data = b->data + IBucketSize; zib.data = z->data + IBucketSize; zib.n = 0; - zib.next = 0; + zib.depth = 0; for(;;){ buck = buildbucket(ix, ies, &ib); found += ib.n; |
