Round used sectors up in lvm device scanner.
This commit is contained in:
parent
5ab60c6dfa
commit
a1ebb5205b
|
@ -28,6 +28,7 @@
|
||||||
#include "util/report.h"
|
#include "util/report.h"
|
||||||
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <QtMath>
|
||||||
|
|
||||||
#include <KDiskFreeSpaceInfo>
|
#include <KDiskFreeSpaceInfo>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
@ -171,7 +172,7 @@ Partition* LvmDevice::scanPartition(const QString& lvPath, PartitionTable* pTabl
|
||||||
if (mounted && freeSpaceInfo.isValid() && mountPoint != QString()) {
|
if (mounted && freeSpaceInfo.isValid() && mountPoint != QString()) {
|
||||||
fs->setSectorsUsed(freeSpaceInfo.used() / logicalSize());
|
fs->setSectorsUsed(freeSpaceInfo.used() / logicalSize());
|
||||||
} else if (fs->supportGetUsed() == FileSystem::cmdSupportFileSystem) {
|
} else if (fs->supportGetUsed() == FileSystem::cmdSupportFileSystem) {
|
||||||
fs->setSectorsUsed(fs->readUsedCapacity(lvPath) / logicalSize());
|
fs->setSectorsUsed(qCeil(fs->readUsedCapacity(lvPath) / static_cast<float>(logicalSize())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue