summaryrefslogtreecommitdiffstats
path: root/src/cmd/venti/srv/index.c
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2011-06-02 09:33:56 -0400
committerRuss Cox <rsc@swtch.com>2011-06-02 09:33:56 -0400
commitf5a8ea6fd8908c6f42670b8546239fdbc7fdbf03 (patch)
treef9e6abdcd5c651adf191f8a9b2dd9655404313a9 /src/cmd/venti/srv/index.c
parent7fb06adf54aa6e47974673dcdeb328780927b8e6 (diff)
downloadplan9port-f5a8ea6fd8908c6f42670b8546239fdbc7fdbf03.tar.gz
plan9port-f5a8ea6fd8908c6f42670b8546239fdbc7fdbf03.zip
venti: import changes from plan 9
R=rsc CC=plan9port.codebot http://codereview.appspot.com/4523057
Diffstat (limited to 'src/cmd/venti/srv/index.c')
-rw-r--r--src/cmd/venti/srv/index.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cmd/venti/srv/index.c b/src/cmd/venti/srv/index.c
index 0b68928a..07bf81c8 100644
--- a/src/cmd/venti/srv/index.c
+++ b/src/cmd/venti/srv/index.c
@@ -328,16 +328,20 @@ newindex(char *name, ISect **sects, int n)
}
if(nb >= ((u64int)1 << 32)){
- seterr(EBug, "index too large");
- return nil;
+ fprint(2, "%s: index is 2^32 blocks or more; ignoring some of it\n",
+ argv0);
+ nb = ((u64int)1 << 32) - 1;
}
div = (((u64int)1 << 32) + nb - 1) / nb;
- ub = (((u64int)1 << 32) - 1) / div + 1;
if(div < 100){
- seterr(EBug, "index divisor too coarse [%lld buckets]", nb);
- return nil;
+ fprint(2, "%s: index divisor %d too coarse; "
+ "index larger than needed, ignoring some of it\n",
+ argv0, div);
+ div = 100;
+ nb = (((u64int)1 << 32) - 1) / (100 - 1);
}
+ ub = (((u64int)1 << 32) - 1) / div + 1;
if(ub > nb){
seterr(EBug, "index initialization math wrong");
return nil;