Remove FIDTRIM.
Remove FIDTRIM support, which isn't meaningful on UFS-based flash
devices. Modern devices require FBE/FDE which gives us better
protection against trimmed data lingering around.
Bug: 67041047
Test: builds, boots
Change-Id: I38d7d6961edf2047592b87c74b2a0f5906fb54e2
Merged-In: I4fb194c5d5ef13f413c02acedfbaaf79c567582b
diff --git a/TrimTask.cpp b/TrimTask.cpp
index 08e6499..0eea715 100644
--- a/TrimTask.cpp
+++ b/TrimTask.cpp
@@ -34,9 +34,6 @@
#include <sys/wait.h>
#include <fcntl.h>
-/* From a would-be kernel header */
-#define FIDTRIM _IOWR('f', 128, struct fstrim_range) /* Deep discard trim */
-
#define BENCHMARK_ENABLED 1
using android::base::StringPrintf;
@@ -127,7 +124,7 @@
range.len = ULLONG_MAX;
nsecs_t start = systemTime(SYSTEM_TIME_BOOTTIME);
- if (ioctl(fd, (mFlags & Flags::kDeepTrim) ? FIDTRIM : FITRIM, &range)) {
+ if (ioctl(fd, FITRIM, &range)) {
PLOG(WARNING) << "Trim failed on " << path;
notifyResult(path, -1, -1);
} else {