diff options
| -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)); |
