vold: Idle-maint issues discards fully
Change-Id: Ib20a55e8761aa740b530803f029ecb36256fe9aa
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
diff --git a/IdleMaint.cpp b/IdleMaint.cpp
index 62086cd..a2b5faa 100644
--- a/IdleMaint.cpp
+++ b/IdleMaint.cpp
@@ -225,6 +225,9 @@
static int startGc(const std::list<std::string>& paths) {
for (const auto& path : paths) {
LOG(DEBUG) << "Start GC on " << path;
+ if (!WriteStringToFile("1", path + "/discard_granularity")) {
+ PLOG(WARNING) << "Set discard gralunarity failed on" << path;
+ }
if (!WriteStringToFile("1", path + "/gc_urgent")) {
PLOG(WARNING) << "Start GC failed on " << path;
}
@@ -238,6 +241,9 @@
if (!WriteStringToFile("0", path + "/gc_urgent")) {
PLOG(WARNING) << "Stop GC failed on " << path;
}
+ if (!WriteStringToFile("16", path + "/discard_granularity")) {
+ PLOG(WARNING) << "Set discard gralunarity failed on" << path;
+ }
}
return android::OK;
}