Skip to content

Commit

Permalink
refactor(cleanup.py): use allocated_size var for getAllocatedSize result
Browse files Browse the repository at this point in the history
Signed-off-by: Ronan Abhamon <[email protected]>
  • Loading branch information
Wescoeur committed Jan 6, 2025
1 parent f7b2512 commit d176754
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,13 @@ def canLiveCoalesce(self, speed):
feasibleSize = False
allowedDownTime = \
self.TIMEOUT_SAFETY_MARGIN * self.LIVE_LEAF_COALESCE_TIMEOUT
vhd_size = self.getAllocatedSize()
allocated_size = self.getAllocatedSize()
if speed:
feasibleSize = \
vhd_size // speed < allowedDownTime
allocated_size // speed < allowedDownTime
else:
feasibleSize = \
vhd_size < self.LIVE_LEAF_COALESCE_MAX_SIZE
allocated_size < self.LIVE_LEAF_COALESCE_MAX_SIZE

return (feasibleSize or
self.getConfig(self.DB_LEAFCLSC) == self.LEAFCLSC_FORCE)
Expand Down Expand Up @@ -901,7 +901,7 @@ def coalesce(self) -> int:
def _doCoalesceVHD(vdi):
try:
startTime = time.time()
vhdSize = vdi.getAllocatedSize()
allocated_size = vdi.getAllocatedSize()
coalesced_size = vdi.coalesce()
endTime = time.time()
vdi.sr.recordStorageSpeed(startTime, endTime, coalesced_size)
Expand Down

0 comments on commit d176754

Please sign in to comment.