Rev 2894: Merge readv fix. in http://people.ubuntu.com/~robertc/baz2.0/index
Robert Collins
robertc at robertcollins.net
Sat Oct 6 08:30:54 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/index
------------------------------------------------------------
revno: 2894
revision-id: robertc at robertcollins.net-20071006073049-opssv3mahh830h6v
parent: robertc at robertcollins.net-20071005104511-e1uy11glm79wrjtb
parent: robertc at robertcollins.net-20071006072506-fypnagvqddbyh4q9
committer: Robert Collins <robertc at robertcollins.net>
branch nick: index
timestamp: Sat 2007-10-06 17:30:49 +1000
message:
Merge readv fix.
modified:
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
------------------------------------------------------------
revno: 2890.1.1
revision-id: robertc at robertcollins.net-20071006072506-fypnagvqddbyh4q9
parent: pqm at pqm.ubuntu.com-20071005032619-b6c99y625rawducb
committer: Robert Collins <robertc at robertcollins.net>
branch nick: readv
timestamp: Sat 2007-10-06 17:25:06 +1000
message:
Tweak readv read-expansion logic.
modified:
bzrlib/transport/__init__.py transport.py-20050711165921-4978aa7ce1285ad5
=== modified file 'bzrlib/transport/__init__.py'
--- a/bzrlib/transport/__init__.py 2007-10-04 05:09:58 +0000
+++ b/bzrlib/transport/__init__.py 2007-10-06 07:25:06 +0000
@@ -673,15 +673,18 @@
yield None
return empty_yielder()
# expand by page size at either end
- expansion = self.recommended_page_size()
- reduction = expansion / 2
+ maximum_expansion = self.recommended_page_size()
new_offsets = []
for offset, length in offsets:
+ expansion = maximum_expansion - length
+ if expansion < 0:
+ # we're asking for more than the minimum read anyway.
+ expansion = 0
+ reduction = expansion / 2
new_offset = offset - reduction
new_length = length + expansion
if new_offset < 0:
# don't ask for anything < 0
- new_length -= new_offset
new_offset = 0
if (upper_limit is not None and
new_offset + new_length > upper_limit):
More information about the bazaar-commits
mailing list