Use cached values for resizing volume groups.
This commit is contained in:
parent
aa5daf0378
commit
9c7db501bf
|
@ -64,6 +64,10 @@ public:
|
|||
virtual bool operator==(const Device& other) const;
|
||||
virtual bool operator!=(const Device& other) const;
|
||||
|
||||
virtual QString& name() {
|
||||
return m_Name; /**< @return the Device's name, usually some manufacturer string */
|
||||
}
|
||||
|
||||
virtual const QString& name() const {
|
||||
return m_Name; /**< @return the Device's name, usually some manufacturer string */
|
||||
}
|
||||
|
|
|
@ -78,8 +78,9 @@ ResizeVolumeGroupOperation::ResizeVolumeGroupOperation(LvmDevice& d, const QList
|
|||
movePE += lvm2PVFs->allocatedPE();
|
||||
}
|
||||
qint64 growPE = 0;
|
||||
for (const auto &p : toInsertList) // FIXME: qAsConst
|
||||
growPE += p->capacity() / LvmDevice::getPeSize(d.name());
|
||||
for (const auto &p : toInsertList) { // FIXME: qAsConst
|
||||
growPE += p->capacity() / device().peSize();
|
||||
}
|
||||
|
||||
if ( movePE > (freePE + growPE)) {
|
||||
// *ABORT* can't move
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
#include "util/report.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
|
|
Loading…
Reference in New Issue