read random date in bulk to reduce syscalls
This commit is contained in:
@ -8,12 +8,12 @@
|
||||
#ifndef REHDD_H_
|
||||
#define REHDD_H_
|
||||
|
||||
#define REHDD_VERSION "bV0.2.1"
|
||||
#define REHDD_VERSION "bV0.2.2"
|
||||
|
||||
// Drive handling Settings
|
||||
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
|
||||
#define WORSE_POWERUP 10000 //mark drive if at this limit or beyond
|
||||
#define SHRED_ITERATIONS 3
|
||||
#define SHRED_ITERATIONS 3U
|
||||
#define FROZEN_TIMEOUT 10 //After this timeout (minutes) the drive will be marked as frozen
|
||||
|
||||
// Logger Settings
|
||||
@ -23,14 +23,13 @@
|
||||
#define SOFTWARE_VERSION "alpha"
|
||||
#define HARDWARE_VERSION "generic"
|
||||
|
||||
//#define LOG_LEVEL_HIGH //log everything, like drive scann thread
|
||||
//#define LOG_LEVEL_HIGH //log everything, like drive scan thread
|
||||
#ifndef LOG_LEVEL_HIGH
|
||||
#define LOG_LEVEL_LOW //log only user actions and tasks
|
||||
#endif
|
||||
|
||||
// Logic
|
||||
//#define DRYRUN //don´t touch the drives
|
||||
//#define DEMO_DRIVE_SIZE 1024*1024*256 // 256MB used for shredding only
|
||||
#define FROZEN_ALERT //show alert if drive is frozen
|
||||
#define ZERO_CHECK_ALERT //check drive after shred if all bytes are zero, show alert if this fails
|
||||
|
||||
|
@ -17,11 +17,12 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define CHUNK_SIZE 1024*1024*2 //amount of bytes that are overwritten at once
|
||||
#define SHRED_ITERATIONS 3 //overwrite the drive multiple times, last time with zeros
|
||||
#define CHUNK_DIMENSION 100U //amount of chunks are read at once from random source
|
||||
|
||||
//#define DEMO_DRIVE_SIZE 1024*1024*256 // 256MB
|
||||
//#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
|
||||
|
||||
typedef int fileDescriptor;
|
||||
|
||||
@ -38,7 +39,7 @@ public:
|
||||
private:
|
||||
fileDescriptor randomSrcFileDiscr;
|
||||
fileDescriptor driveFileDiscr;
|
||||
unsigned char caChunk[CHUNK_SIZE];
|
||||
unsigned char caChunk[CHUNK_DIMENSION][CHUNK_SIZE];
|
||||
unsigned long ulDriveByteSize;
|
||||
unsigned long ulDriveByteOverallCount = 0; //all bytes shredded in all iterations + checking -> used for progress calculation
|
||||
double d32Percent = 0.0;
|
||||
|
Reference in New Issue
Block a user