From 6f50aa39e741a1d1f3081665d0b7f8d56b7b793c Mon Sep 17 00:00:00 2001 From: Vladimir Chtchetkine Date: Thu, 26 Apr 2012 08:20:18 -0700 Subject: Add an option to set custom size for cache partition Change-Id: I1be43697ee04f46c5839c4d23e461d54eefc450f --- android/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'android/main.c') diff --git a/android/main.c b/android/main.c index 51d481c..d9d2274 100644 --- a/android/main.c +++ b/android/main.c @@ -723,6 +723,18 @@ int main(int argc, char **argv) } } + if (hw->disk_cachePartition_path && opts->cache_size) { + /* Set cache partition size per user options. */ + char* end; + long sizeMB = strtol(opts->cache_size, &end, 0); + + if (sizeMB < 0 || *end != 0) { + derror( "-cache-size must be followed by a positive integer" ); + exit(1); + } + hw->disk_cachePartition_size = (uint64_t) sizeMB * ONE_MB; + } + /** SD CARD PARTITION */ if (!hw->hw_sdCard) { -- cgit v1.1