filter drives with zero capacity
This commit is contained in:
parent
0ad7de4352
commit
cb421885d0
@ -89,6 +89,7 @@ private:
|
|||||||
static void startShredAllDrives(list <Drive>* plistDrives);
|
static void startShredAllDrives(list <Drive>* plistDrives);
|
||||||
static void updateShredMetrics(list <Drive>* plistDrives);
|
static void updateShredMetrics(list <Drive>* plistDrives);
|
||||||
static void filterIgnoredDrives(list <Drive>* plistDrives);
|
static void filterIgnoredDrives(list <Drive>* plistDrives);
|
||||||
|
static void filterInvalidDrives(list <Drive>* plistDrives);
|
||||||
static void filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives);
|
static void filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives);
|
||||||
static void addSMARTData(list <Drive>* plistDrives);
|
static void addSMARTData(list <Drive>* plistDrives);
|
||||||
static void ThreadScanDevices();
|
static void ThreadScanDevices();
|
||||||
|
@ -107,6 +107,7 @@ void reHDD::ThreadScanDevices()
|
|||||||
searchDrives(&listNewDrives); // search for new drives and store them in list
|
searchDrives(&listNewDrives); // search for new drives and store them in list
|
||||||
filterIgnoredDrives(&listNewDrives); // filter out ignored drives
|
filterIgnoredDrives(&listNewDrives); // filter out ignored drives
|
||||||
addSMARTData(&listNewDrives); // add S.M.A.R.T. Data to the drives
|
addSMARTData(&listNewDrives); // add S.M.A.R.T. Data to the drives
|
||||||
|
filterInvalidDrives(&listNewDrives); // filter out drives that report zero capacity
|
||||||
mxDrives.unlock();
|
mxDrives.unlock();
|
||||||
write(fdNewDrivesInformPipe[1], "A", 1);
|
write(fdNewDrivesInformPipe[1], "A", 1);
|
||||||
sleep(5); // sleep 5 sec
|
sleep(5); // sleep 5 sec
|
||||||
@ -396,6 +397,27 @@ void reHDD::filterIgnoredDrives(list <Drive>* plistDrives)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief filter out drives that are not indented for processing
|
||||||
|
* \param pointer of list <Drive>* plistDrives
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
void reHDD::filterInvalidDrives(list<Drive> *plistDrives)
|
||||||
|
{
|
||||||
|
list<Drive>::iterator it;
|
||||||
|
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
||||||
|
{
|
||||||
|
if (it->getCapacity() == 0U)
|
||||||
|
{
|
||||||
|
#ifdef LOG_LEVEL_HIGH
|
||||||
|
Logger::logThis()->info("Drive reports zero capacity --> ignore this drive: " + it->getPath());
|
||||||
|
#endif
|
||||||
|
it = plistDrives->erase(it);
|
||||||
|
it--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief start shred for all drives
|
* \brief start shred for all drives
|
||||||
* \param pointer of list <Drive>* plistDrives
|
* \param pointer of list <Drive>* plistDrives
|
||||||
@ -583,6 +605,3 @@ void reHDD::handleAbort()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user