diff options
author | Jeff Sharkey | 2016-12-13 12:55:19 -0600 |
---|---|---|
committer | Jeff Sharkey | 2016-12-13 14:28:08 -0600 |
commit | dff44709cf462a3af7eb5770c90e3ada492295b7 (patch) | |
tree | 260698ec335906df76fe1db439baa5f71089a953 /include/private | |
parent | 2361ab0d3172adf472c7a8bbb7030f514543104d (diff) | |
download | platform-system-core-dff44709cf462a3af7eb5770c90e3ada492295b7.tar.gz platform-system-core-dff44709cf462a3af7eb5770c90e3ada492295b7.tar.xz platform-system-core-dff44709cf462a3af7eb5770c90e3ada492295b7.zip |
Define range of GIDs for cached app data.
To support upcoming disk usage calculation optimizations, this change
creates a new GID for each app that will be used to mark its cached
data. We're allocating these unique GIDs so that we can use
quotactl() to track cached data on a per-app basis.
This change also tightens up the implementation of both the cache
and shared GID calculation to ensure that they stay inside the valid
ranges, and includes tests to verify.
Test: builds, boots, tests pass
Bug: 27948817
Change-Id: Ie4377e5aae267f2da39a165888139228995987cb
Diffstat (limited to 'include/private')
-rw-r--r-- | include/private/android_filesystem_config.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index 303156266..f7cf9b808 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h | |||
@@ -157,15 +157,21 @@ | |||
157 | #define AID_MISC 9998 /* access to misc storage */ | 157 | #define AID_MISC 9998 /* access to misc storage */ |
158 | #define AID_NOBODY 9999 | 158 | #define AID_NOBODY 9999 |
159 | 159 | ||
160 | #define AID_APP 10000 /* first app user */ | 160 | #define AID_APP 10000 /* TODO: switch users over to AID_APP_START */ |
161 | #define AID_APP_START 10000 /* first app user */ | ||
162 | #define AID_APP_END 19999 /* last app user */ | ||
161 | 163 | ||
162 | #define AID_ISOLATED_START 99000 /* start of uids for fully isolated sandboxed processes */ | 164 | #define AID_CACHE_GID_START 20000 /* start of gids for apps to mark cached data */ |
163 | #define AID_ISOLATED_END 99999 /* end of uids for fully isolated sandboxed processes */ | 165 | #define AID_CACHE_GID_END 29999 /* end of gids for apps to mark cached data */ |
164 | |||
165 | #define AID_USER 100000 /* offset for uid ranges for each user */ | ||
166 | 166 | ||
167 | #define AID_SHARED_GID_START 50000 /* start of gids for apps in each user to share */ | 167 | #define AID_SHARED_GID_START 50000 /* start of gids for apps in each user to share */ |
168 | #define AID_SHARED_GID_END 59999 /* start of gids for apps in each user to share */ | 168 | #define AID_SHARED_GID_END 59999 /* end of gids for apps in each user to share */ |
169 | |||
170 | #define AID_ISOLATED_START 99000 /* start of uids for fully isolated sandboxed processes */ | ||
171 | #define AID_ISOLATED_END 99999 /* end of uids for fully isolated sandboxed processes */ | ||
172 | |||
173 | #define AID_USER 100000 /* TODO: switch users over to AID_USER_OFFSET */ | ||
174 | #define AID_USER_OFFSET 100000 /* offset for uid ranges for each user */ | ||
169 | 175 | ||
170 | #if !defined(EXCLUDE_FS_CONFIG_STRUCTURES) | 176 | #if !defined(EXCLUDE_FS_CONFIG_STRUCTURES) |
171 | /* | 177 | /* |