Refactor findsize into util away from erase
At first the size was only needed for erase, now it is needed for the
drives interface. The code needed to be refactored to make drive
interface implementation possible.
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I0a23ee23a0de3fd89a9e776b4854e8da9a8ff2e4
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index b52a5f4..6285079 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -69,21 +69,19 @@
case EraseMethod::VerifyGeometry:
{
VerifyDriveGeometry myVerifyGeometry(devPath);
- uint64_t size = myVerifyGeometry.findSizeOfBlockDevice();
- myVerifyGeometry.geometryOkay(size);
+ myVerifyGeometry.geometryOkay();
break;
}
case EraseMethod::LogicalOverWrite:
{
Pattern myErasePattern(devPath);
- myErasePattern.writePattern(myErasePattern.findSizeOfBlockDevice());
+ myErasePattern.writePattern();
break;
}
case EraseMethod::LogicalVerify:
{
Pattern myErasePattern(devPath);
- myErasePattern.verifyPattern(
- myErasePattern.findSizeOfBlockDevice());
+ myErasePattern.verifyPattern();
break;
}
case EraseMethod::VendorSanitize:
@@ -93,13 +91,13 @@
case EraseMethod::ZeroOverWrite:
{
Zero myZero(devPath);
- myZero.writeZero(myZero.findSizeOfBlockDevice());
+ myZero.writeZero();
break;
}
case EraseMethod::ZeroVerify:
{
Zero myZero(devPath);
- myZero.verifyZero(myZero.findSizeOfBlockDevice());
+ myZero.verifyZero();
break;
}
case EraseMethod::SecuredLocked: