Both swap and LVM PV should not use KDiskFreeSpaceInfo.

This commit is contained in:
Andrius Štikonas 2017-01-26 18:07:28 +00:00
parent b5b3af4b22
commit 16c12ddb9e
1 changed files with 2 additions and 2 deletions

View File

@ -193,11 +193,11 @@ static qint64 readSectorsUsedLibParted(PedDisk* pedDisk, const Partition& p)
*/
static void readSectorsUsed(PedDisk* pedDisk, const Device& d, Partition& p, const QString& mountPoint)
{
if (!mountPoint.isEmpty()) {
if (!mountPoint.isEmpty() && p.fileSystem().type() != FileSystem::LinuxSwap && p.fileSystem().type() != FileSystem::Lvm2_PV) {
const KDiskFreeSpaceInfo freeSpaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo(mountPoint);
// KDiskFreeSpaceInfo does not work with swap
if (p.isMounted() && freeSpaceInfo.isValid() && p.fileSystem().type() != FileSystem::LinuxSwap)
if (p.isMounted() && freeSpaceInfo.isValid())
p.fileSystem().setSectorsUsed(freeSpaceInfo.used() / d.logicalSize());
}
else if (p.fileSystem().supportGetUsed() == FileSystem::cmdSupportFileSystem)