Merge "Revert "Correct RBD Provision stats&fix a perf problem""
This commit is contained in:
commit
400f827e75
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user