work around some of the line breaks inserted into the new venti code. Reference: /n/sources/patch/applied/venti-fmt Date: Tue Sep 18 02:49:40 CES 2007 Signed-off-by: rsc@swtch.com --- /sys/src/cmd/venti/srv/fixarenas.c Tue Sep 18 02:49:22 2007 +++ /sys/src/cmd/venti/srv/fixarenas.c Tue Sep 18 02:49:21 2007 @@ -15,6 +15,8 @@ #include "fns.h" #include "whack.h" +#define ROUNDUP(x,n) (((x)+(n)-1)&~((n)-1)) + #pragma varargck type "z" uvlong #pragma varargck type "z" vlong #pragma varargck type "t" uint @@ -794,7 +796,7 @@ ap.arenabase = bestdiff; } - ap.tabbase = (PartBlank+HeadSize+ap.blocksize-1) & ~(ap.blocksize-1); + ap.tabbase = ROUNDUP(PartBlank+HeadSize, ap.blocksize); /* * XXX pick up table, check arenabase. * XXX pick up table, record base name. @@ -806,8 +808,7 @@ */ if(ap.arenabase == 0){ for(i=0; iscore, 32)/ix->div; + addr = is->blockbase + ((bucket - is->start) << is->blocklog); + return addr; +} + static IEntry* nextchunk(Index *ix, ISect *is, IEntry **pie, u64int *paddr, uint *pnbuf) { @@ -55,12 +65,10 @@ bsize = 1<blocklog; iefirst = *pie; - addr = is->blockbase + ((u64int)(hashbits(iefirst->score, 32) / - ix->div - is->start) << is->blocklog); + addr = ie2diskaddr(ix, is, iefirst); nbuf = 0; for(l = &iefirst->nextdirty; (ie = *l) != nil; l = &(*l)->nextdirty){ - naddr = is->blockbase + ((u64int)(hashbits(ie->score, 32) / - ix->div - is->start) << is->blocklog); + naddr = ie2diskaddr(ix, is, ie); if(naddr - addr >= Bufsize) break; nbuf = naddr - addr; @@ -125,8 +133,7 @@ for(l=&chunk; (ie=*l)!=nil; l=&ie->nextdirty){ again: - naddr = is->blockbase + ((u64int)(hashbits(ie->score, - 32) / ix->div - is->start) << is->blocklog); + naddr = ie2diskaddr(ix, is, ie); off = naddr - addr; if(off+bsize > nbuf){ fprint(2, "%s: whoops! addr=0x%llux nbuf=%ud "