Merge "Revert "Correct RBD Provision stats&fix a perf problem""

This commit is contained in:
Jenkins 2017-07-13 09:03:31 +00:00 committed by Gerrit Code Review
commit 400f827e75
1 changed files with 5 additions and 1 deletions

View File

@ -360,6 +360,10 @@ class RBDDriver(driver.CloneableImageVD,
ports.append(port)
return hosts, ports
def _iterate_cb(self, offset, length, exists):
if exists:
self._total_usage += length
def _get_usage_info(self):
with RADOSClient(self) as client:
for t in self.RBDProxy().list(client.ioctx):
@ -368,7 +372,7 @@ class RBDDriver(driver.CloneableImageVD,
# non-default volume_name_template settings. Template
# must start with "volume".
with RBDVolumeProxy(self, t, read_only=True) as v:
self._total_usage += v.size()
v.diff_iterate(0, v.size(), None, self._iterate_cb)
def _update_volume_stats(self):
stats = {