Browse Source

fuse_getattr.cpp

getattr-cache
Antonio SJ Musumeci 9 months ago
parent
commit
83eb2d1740
  1. 12
      src/fuse_getattr.cpp

12
src/fuse_getattr.cpp

@ -108,10 +108,14 @@ namespace l
thread_local static std::unordered_map<std::string,std::string> 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_);

Loading…
Cancel
Save