From a6aae2f5a5949c49475c7ba603a0567b49cd00b6 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Sat, 17 Feb 2018 06:02:30 -0800 Subject: [PATCH] vold: Idle-maint issues discards fully Change-Id: Ib20a55e8761aa740b530803f029ecb36256fe9aa Signed-off-by: Jaegeuk Kim --- IdleMaint.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IdleMaint.cpp b/IdleMaint.cpp index 62086cd..a2b5faa 100644 --- a/IdleMaint.cpp +++ b/IdleMaint.cpp @@ -225,6 +225,9 @@ static bool waitForGc(const std::list& paths) { static int startGc(const std::list& 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 @@ static int stopGc(const std::list& paths) { 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; }