Split cache clearing into two phases.

Use newly defined "V2_DEFY_QUOTA" flag to split cache clearing into
two phases: clearing data for apps above their quotas, and then
pushing deeper by clearing data for apps below their quotas.

Add placeholder comments for other data types that we're planning to
add shortly.  Route all clearing behavior through this new method,
which remains guarded behind a flag for now.

Test: builds, boots
Bug: 34692014
Change-Id: I678d7b4e2bf6c837dd8a9adbc36a53015907f75f
This commit is contained in:
Jeff Sharkey
2017-02-22 11:47:15 -07:00
parent 78f6f7f543
commit 458428ea66
3 changed files with 88 additions and 57 deletions

View File

@@ -1677,8 +1677,8 @@ public class StorageManager {
"Well this is embarassing; we can't allocate " + bytes + " for " + file);
}
private static final String XATTR_ATOMIC = "user.atomic";
private static final String XATTR_TOMBSTONE = "user.tombstone";
private static final String XATTR_CACHE_ATOMIC = "user.cache_atomic";
private static final String XATTR_CACHE_TOMBSTONE = "user.cache_tombstone";
/** {@hide} */
private static void setCacheBehavior(File path, String name, boolean enabled)
@@ -1736,7 +1736,7 @@ public class StorageManager {
* to all contained files and directories.
*/
public void setCacheBehaviorAtomic(File path, boolean atomic) throws IOException {
setCacheBehavior(path, XATTR_ATOMIC, atomic);
setCacheBehavior(path, XATTR_CACHE_ATOMIC, atomic);
}
/**
@@ -1744,7 +1744,7 @@ public class StorageManager {
* {@link #setCacheBehaviorAtomic(File, boolean)}.
*/
public boolean isCacheBehaviorAtomic(File path) throws IOException {
return isCacheBehavior(path, XATTR_ATOMIC);
return isCacheBehavior(path, XATTR_CACHE_ATOMIC);
}
/**
@@ -1764,7 +1764,7 @@ public class StorageManager {
* </p>
*/
public void setCacheBehaviorTombstone(File path, boolean tombstone) throws IOException {
setCacheBehavior(path, XATTR_TOMBSTONE, tombstone);
setCacheBehavior(path, XATTR_CACHE_TOMBSTONE, tombstone);
}
/**
@@ -1772,7 +1772,7 @@ public class StorageManager {
* {@link #setCacheBehaviorTombstone(File, boolean)}.
*/
public boolean isCacheBehaviorTombstone(File path) throws IOException {
return isCacheBehavior(path, XATTR_TOMBSTONE);
return isCacheBehavior(path, XATTR_CACHE_TOMBSTONE);
}
private final Object mFuseAppLoopLock = new Object();