From 83eb2d1740a806280fbf5bd75f2725899f4b23bb Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 13 Feb 2024 20:02:52 -0600 Subject: [PATCH] fuse_getattr.cpp --- src/fuse_getattr.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fuse_getattr.cpp b/src/fuse_getattr.cpp index bf9133f4..64fc7b24 100644 --- a/src/fuse_getattr.cpp +++ b/src/fuse_getattr.cpp @@ -108,10 +108,14 @@ namespace l thread_local static std::unordered_map cache; auto i = cache.find(fusepath_); - - rv = searchFunc_(branches_,fusepath_,&basepaths); - if(rv == -1) - return -errno; + if(i == cache.end()) + { + rv = searchFunc_(branches_,fusepath_,&basepaths); + if(rv == -1) + return -errno; + + cache.insert({fusepath_,basepaths[0]}); + } fullpath = fs::path::make(basepaths[0],fusepath_);