summaryrefslogtreecommitdiff
path: root/jni/node_test.cpp
diff options
context:
space:
mode:
authorZim <zezeozue@google.com>2020-11-17 15:58:29 +0000
committeralk3pInjection <webmaster@raspii.tech>2021-10-12 21:01:08 +0800
commitc5c44be823f512af4bc5427e608dcedcc37b984f (patch)
tree69e6b468baab413f3b7d71c224f4987f867777cb /jni/node_test.cpp
parent83db50706adf64e9fe498d4f27f23d49289f3cd1 (diff)
Support redaction and ContentResolver#open with passthroughHEADlineage-18.1
With FUSE passthrough enabled we can simplify the following policies: 1. Redaction: Always use passthrough for open(2) without redaction and non-passthrough for open(2) with redaction. This works because different VFS page caches are used for passthrough vs non-passthrough. When passthrough is disabled, we still use the policy introduced in I6eb1903ee22b8d713fe792ad8fef457a140e91f1 2. ContentResolver#open: All opens go through the FUSE filesystem, this avoids the page cache inconsistency problems entirely! Hence, we don't need any delicate file-locking algorithm to keep the cache consistent. Note that we still have to handle the dentry cache inconsistency problems from unlink(2)/rename(2) within MediaProvider. When passthrough is disabled, we still use the policy introduced in I7726a75a51869c0e3ea3856103dd501b1aa19d14 Bug: 168023149 Test: atest ScopedStorageCoreHostTest#testVfsCacheConsistency Change-Id: I8927cfb16f82578c9062036b3b46ad238e408ce6 Signed-off-by: alk3pInjection <webmaster@raspii.tech>
Diffstat (limited to 'jni/node_test.cpp')
-rw-r--r--jni/node_test.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/jni/node_test.cpp b/jni/node_test.cpp
index 357cea8e..0d7417f9 100644
--- a/jni/node_test.cpp
+++ b/jni/node_test.cpp
@@ -217,7 +217,8 @@ TEST_F(NodeTest, LookupAbsolutePath) {
TEST_F(NodeTest, AddDestroyHandle) {
unique_node_ptr node = CreateNode(nullptr, "/path");
- handle* h = new handle(-1, new mediaprovider::fuse::RedactionInfo, true /* cached */);
+ handle* h = new handle(-1, new mediaprovider::fuse::RedactionInfo, true /* cached */,
+ false /* passthrough */);
node->AddHandle(h);
ASSERT_TRUE(node->HasCachedHandle());
@@ -228,8 +229,8 @@ TEST_F(NodeTest, AddDestroyHandle) {
// the node in question.
EXPECT_DEATH(node->DestroyHandle(h), "");
EXPECT_DEATH(node->DestroyHandle(nullptr), "");
- std::unique_ptr<handle> h2(
- new handle(-1, new mediaprovider::fuse::RedactionInfo, true /* cached */));
+ std::unique_ptr<handle> h2(new handle(-1, new mediaprovider::fuse::RedactionInfo,
+ true /* cached */, false /* passthrough */));
EXPECT_DEATH(node->DestroyHandle(h2.get()), "");
}