removed flush in shred

This commit is contained in:
Hendrik Schutter 2022-05-15 21:28:28 +02:00
parent e49c1a231c
commit 7f0926a271
2 changed files with 2 additions and 24 deletions

View File

@ -17,12 +17,12 @@
#include <unistd.h>
#include <string.h>
#define CHUNK_SIZE 1024*1024*2 //amount of bytes that are overwritten at once
#define CHUNK_SIZE 1024*1024*2 //amount of bytes that are overwritten at once --> 2MB
#define CHUNK_DIMENSION 100U //amount of chunks are read at once from random source
//#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
//#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
typedef int fileDescriptor;

View File

@ -109,17 +109,6 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
#ifdef LOG_LEVEL_HIGH
Logger::logThis()->info("Shred-Task: Read new random data - Drive: " + drive->getSerial());
#endif
/*
int retFDataSync = fdatasync(driveFileDiscr);
if(retFDataSync != 0)
{
std::string errorMsg(strerror(retFDataSync));
Logger::logThis()->error("Shred-Task: Flush drive failed! " + errorMsg + " - Drive: " + drive->getSerial());
perror("unable to flush random data");
cleanup();
return -1;
}
*/
}
@ -169,17 +158,6 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
return -1;
}
}//end one chunk write
/*
int retFDataSync = fdatasync(driveFileDiscr);
if(retFDataSync != 0)
{
std::string errorMsg(strerror(retFDataSync));
Logger::logThis()->error("Shred-Task: Flush drive failed! " + errorMsg + " - Drive: " + drive->getSerial());
perror("unable to flush random data");
cleanup();
return -1;
}
*/
if(0 != iRewindDrive(driveFileDiscr))
{
cleanup();