diff options
author | 2021-03-10 12:06:54 +0000 | |
---|---|---|
committer | 2021-03-15 16:12:45 +0000 | |
commit | e543368157b5d21394ebee43c4a39945184d5105 (patch) | |
tree | 908abe5f8e8e336f50096c990cd629b2d96e950b /jni/node-inl.h | |
parent | 3ccf6a0665ee41d41777851eda9ad789d909564d (diff) |
Improve transcoded FUSE cache/passthrough access
This change updates the node#transforms_complete flag on each lookup.
With the correct transforms_complete flag we can ensure the kernel
page cache has the correct bytes after the transcode file cache has
been cleared.
We achieve this by flusing the page cache on FUSE_OPEN
if transforms is not complete. This fixes the case where the following
happens:
1. Read transcoded content and set transforms_complete=true
2. Clear the transcoded cache
3. Read transcoded content again
Lastly, we also set direct_io=true if transforms_complete=false. This
will allow us handle transcode failures more gracefully by returning
the original bytes without corrupting the kernel page cache
Test: atest TranscodeTest
Bug: 181846007
Change-Id: Ibb93a79f2544688bf440180d9e1dbae61f76d287
Diffstat (limited to 'jni/node-inl.h')
-rw-r--r-- | jni/node-inl.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/jni/node-inl.h b/jni/node-inl.h index 9b30e8742..e531a0a2b 100644 --- a/jni/node-inl.h +++ b/jni/node-inl.h @@ -285,7 +285,9 @@ class node { return transforms_complete_.load(std::memory_order_acquire); } - void SetTransformsComplete() { transforms_complete_.store(true, std::memory_order_release); } + void SetTransformsComplete(bool complete) { + transforms_complete_.store(complete, std::memory_order_release); + } node* GetParent() const { std::lock_guard<std::recursive_mutex> guard(*lock_); |