From 503c493daf29543bc07c08949ca5ecbcd8a6dc1d Mon Sep 17 00:00:00 2001 From: Chantara Tith Date: Sun, 26 Jun 2016 00:25:05 +0700 Subject: [PATCH] Fix LV used space. --- src/core/lvmdevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/lvmdevice.cpp b/src/core/lvmdevice.cpp index c658d7f..80b4125 100644 --- a/src/core/lvmdevice.cpp +++ b/src/core/lvmdevice.cpp @@ -112,9 +112,12 @@ Partition* LvmDevice::scanPartition(const QString& lvpath, const LvmDevice& dev, const KDiskFreeSpaceInfo freeSpaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo(mountPoint); FileSystem* fs = FileSystemFactory::create(FileSystem::detectFileSystem(lvpath), 0, lvSize - 1); + + //TODO: fix used space report. currently incorrect if (mounted && freeSpaceInfo.isValid() && mountPoint != QString()) { - //TODO: fix used space report. currently incorrect fs->setSectorsUsed(freeSpaceInfo.used() / logicalSize()); + } else if (fs->supportGetUsed() == FileSystem::cmdSupportFileSystem) { + fs->setSectorsUsed(fs->readUsedCapacity(lvpath) / logicalSize()); } if (fs->supportGetLabel() != FileSystem::cmdSupportNone) {