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 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 {
|
virtual const QString& name() const {
|
||||||
return m_Name; /**< @return the Device's name, usually some manufacturer string */
|
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();
|
movePE += lvm2PVFs->allocatedPE();
|
||||||
}
|
}
|
||||||
qint64 growPE = 0;
|
qint64 growPE = 0;
|
||||||
for (const auto &p : toInsertList) // FIXME: qAsConst
|
for (const auto &p : toInsertList) { // FIXME: qAsConst
|
||||||
growPE += p->capacity() / LvmDevice::getPeSize(d.name());
|
growPE += p->capacity() / device().peSize();
|
||||||
|
}
|
||||||
|
|
||||||
if ( movePE > (freePE + growPE)) {
|
if ( movePE > (freePE + growPE)) {
|
||||||
// *ABORT* can't move
|
// *ABORT* can't move
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#include "util/report.h"
|
#include "util/report.h"
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue