mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-25 13:07:37 +00:00
immutable: ValidatedExtendedURIProxy computes and stores the tail data size as a convenience to its caller.
The "tail data size" is how many of the bytes of the tail segment are data (as opposed to padding).
This commit is contained in:
parent
2e762f39f6
commit
7d15928faa
@ -204,6 +204,7 @@ class ValidatedExtendedURIProxy:
|
||||
self.block_size = None
|
||||
self.share_size = None
|
||||
self.num_segments = None
|
||||
self.tail_data_size = None
|
||||
self.tail_segment_size = None
|
||||
|
||||
# optional
|
||||
@ -246,11 +247,11 @@ class ValidatedExtendedURIProxy:
|
||||
self.block_size = mathutil.div_ceil(self.segment_size, self._verifycap.needed_shares)
|
||||
self.num_segments = mathutil.div_ceil(self._verifycap.size, self.segment_size)
|
||||
|
||||
tail_data_size = self._verifycap.size % self.segment_size
|
||||
if not tail_data_size:
|
||||
tail_data_size = self.segment_size
|
||||
self.tail_data_size = self._verifycap.size % self.segment_size
|
||||
if not self.tail_data_size:
|
||||
self.tail_data_size = self.segment_size
|
||||
# padding for erasure code
|
||||
self.tail_segment_size = mathutil.next_multiple(tail_data_size, self._verifycap.needed_shares)
|
||||
self.tail_segment_size = mathutil.next_multiple(self.tail_data_size, self._verifycap.needed_shares)
|
||||
|
||||
# Ciphertext hash tree root is mandatory, so that there is at most one ciphertext that
|
||||
# matches this read-cap or verify-cap. The integrity check on the shares is not
|
||||
|
Loading…
x
Reference in New Issue
Block a user