diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index aa9c0af36..90779b7fa 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -128,11 +128,11 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass empty_space_size = 1; } - qint64 firstFreeSector = empty_space_size MiB / dev->logicalSectorSize() + 1; + qint64 firstFreeSector = empty_space_size MiB / dev->logicalSize() + 1; if ( isEfi ) { - qint64 lastSector = firstFreeSector + ( uefisys_part_size MiB / dev->logicalSectorSize() ); + qint64 lastSector = firstFreeSector + ( uefisys_part_size MiB / dev->logicalSize() ); core->createPartitionTable( dev, PartitionTable::gpt ); Partition* efiPartition = KPMHelpers::createNewPartition( dev->partitionTable(), @@ -157,7 +157,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass } bool shouldCreateSwap = false; - qint64 availableSpaceB = ( dev->totalSectors() - firstFreeSector ) * dev->logicalSectorSize(); + qint64 availableSpaceB = ( dev->totalLogical() - firstFreeSector ) * dev->logicalSize(); qint64 suggestedSwapSizeB = swapSuggestion( availableSpaceB ); qint64 requiredSpaceB = ( Calamares::JobQueue::instance()-> @@ -168,10 +168,10 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass // If there is enough room for ESP + root + swap, create swap, otherwise don't. shouldCreateSwap = availableSpaceB > requiredSpaceB; - qint64 lastSectorForRoot = dev->totalSectors() - 1; //last sector of the device + qint64 lastSectorForRoot = dev->totalLogical() - 1; //last sector of the device if ( shouldCreateSwap ) { - lastSectorForRoot -= suggestedSwapSizeB / dev->logicalSectorSize() + 1; + lastSectorForRoot -= suggestedSwapSizeB / dev->logicalSize() + 1; } Partition* rootPartition = nullptr; @@ -213,7 +213,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass PartitionRole( PartitionRole::Primary ), FileSystem::LinuxSwap, lastSectorForRoot + 1, - dev->totalSectors() - 1 + dev->totalLogical() - 1 ); } else @@ -224,7 +224,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass PartitionRole( PartitionRole::Primary ), FileSystem::LinuxSwap, lastSectorForRoot + 1, - dev->totalSectors() - 1, + dev->totalLogical() - 1, luksPassphrase ); } diff --git a/src/modules/partition/core/PartitionModel.cpp b/src/modules/partition/core/PartitionModel.cpp index ae15b5c91..648c57932 100644 --- a/src/modules/partition/core/PartitionModel.cpp +++ b/src/modules/partition/core/PartitionModel.cpp @@ -148,7 +148,7 @@ PartitionModel::data( const QModelIndex& index, int role ) const return PartitionInfo::mountPoint( partition ); if ( col == SizeColumn ) { - qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize(); + qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize(); return KFormat().formatByteSize( size ); } cDebug() << "Unknown column" << col; @@ -175,12 +175,12 @@ PartitionModel::data( const QModelIndex& index, int role ) const } } QString prettyFileSystem = KPMHelpers::prettyNameForFileSystemType( partition->fileSystem().type() ); - qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize(); + qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize(); QString prettySize = KFormat().formatByteSize( size ); return QVariant(name + " " + prettyFileSystem + " " + prettySize); } case SizeRole: - return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize(); + return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize(); case IsFreeSpaceRole: return KPMHelpers::isPartitionFreeSpace( partition ); diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index ec1ae5c55..2f4b9410a 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -594,7 +594,7 @@ ChoicePage::doAlongsideApply() qint64 oldLastSector = candidate->lastSector(); qint64 newLastSector = firstSector + m_afterPartitionSplitterWidget->splitPartitionSize() / - dev->logicalSectorSize(); + dev->logicalSize(); m_core->resizePartition( dev, candidate, firstSector, newLastSector ); Partition* newPartition = nullptr; diff --git a/src/modules/partition/gui/PartitionLabelsView.cpp b/src/modules/partition/gui/PartitionLabelsView.cpp index d2629a6e2..a43b6b88b 100644 --- a/src/modules/partition/gui/PartitionLabelsView.cpp +++ b/src/modules/partition/gui/PartitionLabelsView.cpp @@ -47,7 +47,7 @@ QStringList buildUnknownDisklabelTexts( Device* dev ) { QStringList texts = { QObject::tr( "Unpartitioned space or unknown partition table" ), - KFormat().formatByteSize( dev->totalSectors() * dev->logicalSectorSize() ) }; + KFormat().formatByteSize( dev->totalLogical() * dev->logicalSize() ) }; return texts; } diff --git a/src/modules/partition/gui/PartitionSizeController.cpp b/src/modules/partition/gui/PartitionSizeController.cpp index c602501db..d01924e8b 100644 --- a/src/modules/partition/gui/PartitionSizeController.cpp +++ b/src/modules/partition/gui/PartitionSizeController.cpp @@ -135,7 +135,7 @@ PartitionSizeController::updatePartResizerWidget() return; m_updating = true; - qint64 sectorSize = qint64( m_spinBox->value() ) * 1024 * 1024 / m_device->logicalSectorSize(); + qint64 sectorSize = qint64( m_spinBox->value() ) * 1024 * 1024 / m_device->logicalSize(); qint64 firstSector = m_partition->firstSector(); qint64 lastSector = firstSector + sectorSize - 1; @@ -185,7 +185,7 @@ PartitionSizeController::doUpdateSpinBox() { if ( !m_spinBox ) return; - qint64 mbSize = m_partition->length() * m_device->logicalSectorSize() / 1024 / 1024; + qint64 mbSize = m_partition->length() * m_device->logicalSize() / 1024 / 1024; m_spinBox->setValue( mbSize ); if ( m_currentSpinBoxValue != -1 && //if it's not the first time we're setting it m_currentSpinBoxValue != mbSize ) //and the operation changes the SB value diff --git a/src/modules/partition/jobs/ResizePartitionJob.cpp b/src/modules/partition/jobs/ResizePartitionJob.cpp index 65ee13f72..d3fcb75b4 100644 --- a/src/modules/partition/jobs/ResizePartitionJob.cpp +++ b/src/modules/partition/jobs/ResizePartitionJob.cpp @@ -93,7 +93,7 @@ public: break; case FileSystem::cmdSupportFileSystem: { - qint64 byteLength = m_device->logicalSectorSize() * m_length; + qint64 byteLength = m_device->logicalSize() * m_length; bool ok = fs.resize( report, m_partition->partitionPath(), byteLength ); if ( !ok ) return Calamares::JobResult::error(