projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c08be1
)
storage.py: handle num_segments != power-of-two without an assertion
author
Brian Warner
<warner@lothar.com>
Sat, 14 Jul 2007 02:30:21 +0000
(19:30 -0700)
committer
Brian Warner
<warner@lothar.com>
Sat, 14 Jul 2007 02:30:21 +0000
(19:30 -0700)
src/allmydata/storage.py
patch
|
blob
|
history
diff --git
a/src/allmydata/storage.py
b/src/allmydata/storage.py
index b5acdee43e40217507c52597acd9d86204811ffe..80196807e0f365506b7bced729371ea668702b29 100644
(file)
--- a/
src/allmydata/storage.py
+++ b/
src/allmydata/storage.py
@@
-185,7
+185,8
@@
class WriteBucketProxy:
self._segment_size = segment_size
self._num_segments = num_segments
- self._segment_hash_size = (2*num_segments - 1) * HASH_SIZE
+ effective_segments = mathutil.next_power_of_k(num_segments,2)
+ self._segment_hash_size = (2*effective_segments - 1) * HASH_SIZE
# how many share hashes are included in each share? This will be
# about ln2(num_shares).
self._share_hash_size = num_share_hashes * (2+HASH_SIZE)