Improve shred throughput with adaptive chunksize #98

Merged
localhorst merged 10 commits from feature/adaptive-chunksize into master 2026-05-03 10:06:15 +02:00
Showing only changes of commit 716ab5614f - Show all commits
+5 -1
View File
@@ -455,8 +455,10 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
if ((d32Percent - d32TmpPercent) >= 0.01)
{
// set shred percentage
drive->setTaskPercentage(d32TmpPercent);
d32TmpPercent = d32Percent;
// signal process in shredding
write(*ipSignalFd, "A", 1);
}
@@ -563,7 +565,7 @@ double Shred::calcProgress()
unsigned int uiMaxShredIteration = SHRED_ITERATIONS;
#ifdef ZERO_CHECK
uiMaxShredIteration++;
uiMaxShredIteration++; // increment because we will check after SHRED_ITERATIONS the drive for non-zero bytes
#endif
if (this->ulDriveByteSize == 0)
@@ -641,6 +643,8 @@ unsigned int Shred::uiCalcChecksum(fileDescriptor file, Drive *drive, int *ipSig
unsigned int uiChecksum = 0;
unsigned long ulDriveByteCounter = 0U;
Logger::logThis()->info("Check-Task: Starting checksum verification - Drive: " + drive->getSerial());
#ifdef ADAPTIVE_CHUNK_SIZE
size_t checkChunkSize = CHUNK_SIZE_MAX;
#else