summaryrefslogtreecommitdiff
path: root/jni/node-inl.h
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-inl.h
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-inl.h')
-rw-r--r--jni/node-inl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/jni/node-inl.h b/jni/node-inl.h
index 364a3279..c031c971 100644
--- a/jni/node-inl.h
+++ b/jni/node-inl.h
@@ -40,13 +40,15 @@ namespace mediaprovider {
namespace fuse {
struct handle {
- explicit handle(int fd, const RedactionInfo* ri, bool cached) : fd(fd), ri(ri), cached(cached) {
+ explicit handle(int fd, const RedactionInfo* ri, bool cached, bool passthrough)
+ : fd(fd), ri(ri), cached(cached), passthrough(passthrough) {
CHECK(ri != nullptr);
}
const int fd;
const std::unique_ptr<const RedactionInfo> ri;
const bool cached;
+ const bool passthrough;
~handle() { close(fd); }
};