removed flush in shred
This commit is contained in:
parent
e49c1a231c
commit
7f0926a271
|
@ -17,12 +17,12 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.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 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*256L // 256MB
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
|
//#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;
|
typedef int fileDescriptor;
|
||||||
|
|
||||||
|
|
|
@ -109,17 +109,6 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
|
||||||
#ifdef LOG_LEVEL_HIGH
|
#ifdef LOG_LEVEL_HIGH
|
||||||
Logger::logThis()->info("Shred-Task: Read new random data - Drive: " + drive->getSerial());
|
Logger::logThis()->info("Shred-Task: Read new random data - Drive: " + drive->getSerial());
|
||||||
#endif
|
#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;
|
return -1;
|
||||||
}
|
}
|
||||||
}//end one chunk write
|
}//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))
|
if(0 != iRewindDrive(driveFileDiscr))
|
||||||
{
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
Loading…
Reference in New Issue