diff options
| author | SulfurNitride <lukew19@proton.me> | 2026-06-19 20:52:05 -0500 |
|---|---|---|
| committer | SulfurNitride <lukew19@proton.me> | 2026-06-19 20:52:05 -0500 |
| commit | 41a336cc8e53ba062ab791ffd6dc9b90d2c72899 (patch) | |
| tree | 67af0fcf18b6ca6c6e3a9ff7abcb03784be197a2 /src | |
| parent | ea794b1eba77e9b5dd8bea0fe4d3280b67d77a5a (diff) | |
Disable VFS cache for writable handles
Diffstat (limited to 'src')
| -rw-r--r-- | src/src/vfs/mo2filesystem.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/src/vfs/mo2filesystem.cpp b/src/src/vfs/mo2filesystem.cpp index 5176614..d23c2e6 100644 --- a/src/src/vfs/mo2filesystem.cpp +++ b/src/src/vfs/mo2filesystem.cpp @@ -1930,7 +1930,11 @@ void mo2_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info* fi) } fi->fh = fh; - fi->keep_cache = 1; + // Read-only mod/game files are immutable during a session, so keeping the + // page cache is safe and fast. Writable handles can remap the same VFS inode + // from a mod file to a staged copy, and repeated INI API calls need to read + // the just-written staged content rather than stale cached pages. + fi->keep_cache = writable ? 0 : 1; fuse_reply_open(req, fi); } @@ -2215,7 +2219,7 @@ void mo2_create(fuse_req_t req, fuse_ino_t parent, const char* name, mode_t mode } fi->fh = fh; - fi->keep_cache = 1; + fi->keep_cache = 0; struct fuse_entry_param e; std::memset(&e, 0, sizeof(e)); |
