diff options
author | David Lehman <dlehman@redhat.com> | 2012-07-23 11:37:45 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2012-07-26 11:00:27 -0500 |
commit | 34ddf739a14157e9a6f2e2450804322c2cdabc22 (patch) | |
tree | 49281d1e8212ccc66d73ccd23159d5aa428d684b /pyanaconda/storage/partitioning.py | |
parent | 663e4d8f9c7810aab1cfc46db5718b73a28be1fd (diff) | |
download | anaconda-34ddf739a14157e9a6f2e2450804322c2cdabc22.tar.gz anaconda-34ddf739a14157e9a6f2e2450804322c2cdabc22.tar.xz anaconda-34ddf739a14157e9a6f2e2450804322c2cdabc22.zip |
Add capability to grow all requests at a uniform rate.
Diffstat (limited to 'pyanaconda/storage/partitioning.py')
-rw-r--r-- | pyanaconda/storage/partitioning.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py index 48967c89a..e9c06f6d0 100644 --- a/pyanaconda/storage/partitioning.py +++ b/pyanaconda/storage/partitioning.py @@ -1269,7 +1269,7 @@ class Chunk(object): def sortRequests(self): pass - def growRequests(self): + def growRequests(self, uniform=False): """ Calculate growth amounts for requests in this chunk. """ log.debug("Chunk.growRequests: %r" % self) @@ -1285,17 +1285,22 @@ class Chunk(object): while not self.done and self.pool and last_pool != self.pool: last_pool = self.pool # to keep from getting stuck self.base = new_base + if uniform: + growth = last_pool / self.remaining + log.debug("%d requests and %d (%dMB) left in chunk" % (self.remaining, self.pool, self.lengthToSize(self.pool))) for p in self.requests: if p.done: continue - # Each request is allocated free units from the pool - # based on the relative _base_ sizes of the remaining - # growable requests. - share = p.base / float(self.base) - growth = int(share * last_pool) # truncate, don't round + if not uniform: + # Each request is allocated free units from the pool + # based on the relative _base_ sizes of the remaining + # growable requests. + share = p.base / float(self.base) + growth = int(share * last_pool) # truncate, don't round + p.growth += growth self.pool -= growth log.debug("adding %d (%dMB) to %d (%s)" % |