Used space is larger for luks volumes due to payload.
This commit is contained in:
parent
4278172f35
commit
12bc2329a2
|
@ -262,7 +262,7 @@ bool luks::cryptOpen(QWidget* parent, const QString& deviceNode)
|
|||
if (mapperNode.isEmpty())
|
||||
return false;
|
||||
|
||||
loadInnerFileSystem(mapperNode);
|
||||
loadInnerFileSystem(deviceNode, mapperNode);
|
||||
m_isCryptOpen = (m_innerFs != nullptr);
|
||||
|
||||
if (m_isCryptOpen)
|
||||
|
@ -309,7 +309,7 @@ bool luks::cryptClose(const QString& deviceNode)
|
|||
return false;
|
||||
}
|
||||
|
||||
void luks::loadInnerFileSystem(const QString& mapperNode)
|
||||
void luks::loadInnerFileSystem(const QString& deviceNode, const QString& mapperNode)
|
||||
{
|
||||
Q_ASSERT(!m_innerFs);
|
||||
FileSystem::Type innerFsType = detectFileSystem(mapperNode);
|
||||
|
@ -318,7 +318,7 @@ void luks::loadInnerFileSystem(const QString& mapperNode)
|
|||
setLabel(m_innerFs->readLabel(mapperNode));
|
||||
setUUID(m_innerFs->readUUID(mapperNode));
|
||||
if (m_innerFs->supportGetUsed() == FileSystem::cmdSupportFileSystem) // FIXME:also implement checking space if partition is mounted
|
||||
setSectorsUsed(m_innerFs->readUsedCapacity(mapperNode)/m_logicalSectorSize);
|
||||
setSectorsUsed(m_innerFs->readUsedCapacity(mapperNode)/m_logicalSectorSize + getPayloadOffset(deviceNode).toInt());
|
||||
}
|
||||
|
||||
void luks::createInnerFileSystem(FileSystem::Type type)
|
||||
|
|
|
@ -139,7 +139,7 @@ public:
|
|||
bool cryptOpen(QWidget* parent, const QString& deviceNode);
|
||||
bool cryptClose(const QString& deviceNode);
|
||||
|
||||
void loadInnerFileSystem(const QString& mapperNode);
|
||||
void loadInnerFileSystem(const QString& deviceNode, const QString& mapperNode);
|
||||
void createInnerFileSystem(Type type);
|
||||
|
||||
bool mount(Report& report, const QString& deviceNode, const QString& mountPoint) override;
|
||||
|
|
|
@ -367,7 +367,7 @@ void LibPartedBackend::scanDevicePartitions(Device& d, PedDisk* pedDisk)
|
|||
luksFs->setLogicalSectorSize(d.logicalSectorSize());
|
||||
|
||||
if (isCryptOpen) {
|
||||
luksFs->loadInnerFileSystem(mapperNode);
|
||||
luksFs->loadInnerFileSystem(node, mapperNode);
|
||||
|
||||
mountPoint = mountPoints.findByDevice(mapperNode) ?
|
||||
mountPoints.findByDevice(mapperNode)->mountPoint() :
|
||||
|
|
Loading…
Reference in New Issue